similar to: How do I create a new object in testing to test a controller?

Displaying 20 results from an estimated 200 matches similar to: "How do I create a new object in testing to test a controller?"

2011 Jul 19
0
Ruby on Rails Tutorial Chapter 8 Signup Success
I have written the Users controller and Spec tests correctly for the "successful creation" in the User controller however I get the following two errors: 1) UsersController POST ''create'' success should create a user Failure/Error: lambda do count should have been changed by 1, but was changed by 0 #
2009 Jul 30
0
Problem with implicit multipart emails using ActionMailer in Rails 2.3.3
With earlier versions of Rails ActionMailer used to implicitly send multipart (text/plain and text/html) email messages for me, but it looks like now it''s sending two text/plain parts. Simplified details: Here''s my model: class Notifications < ActionMailer::Base def confirmation(sent_at = Time.now) @subject = ''Thank you for registering'' @body
2013 Jun 18
1
Getting rspec error: Net::SMTPServerBusy: Relay access denied
I''m trying to test registration emails (sent with devise), and I keep getting the error: Net::SMTPServerBusy: 454 4.7.1 <model_spec-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org>: Relay access denied I''m running Rails 3.2.11 with Capybara, and I have (temporarily) chopped my spec_helper.rb and test.rb files down to the bare minimum, still getting the error above.
2006 Dec 28
1
ActionMailer/SMTP: Net::SMTPSyntaxError when message body contains only a 'dot'
FYI: I don''t think this is a very well know. It seems that, on some operating systems, ActionMailer/SMTP crashes when it sends an email with only a ''.'' (aka a ''dot'' or a ''period''). Specifically, you get Net::SMTPSyntaxError (502 Error: command not implemented): Environment Details: $ uname -a Linux private1 2.6.15-26-server #1 SMP
2013 Mar 30
0
Scoping issue with irf() from {vars}
Dear all: There seems to be a problem with scoping, for irf() in vars, when called within a function. Try the following: ----------------------- testfun <- function(lags){ data(Canada) var.2c <- VAR(Canada, p = lags, type = "const") print(var.2c) } testfun(lags=3) ## Everything OK. Now this: testfun2 <- function(lags){ data(Canada) var.2c <- VAR(Canada, p = lags, type =
2004 Aug 21
0
Microsoft Windows Network: The local device name is already in use.
Hey, I'm using SAMBA 2.0.9 and only on very large file transfers (500 MB or more) to or from the SAMBA share after I logout and log back in I'll get this error message,"Microsoft Windows Network: The local device name is already in use." If I wait just a couple of minutes the connection will be made and everything is fine including access to the share once again. SAMBA 2.0.9
2011 Oct 19
0
Email Anonymization
I''m working on an email anonymization feature for my rails app (kind of like craigslist). I''ve configured postfix to pipe all emails addressed to user-*@example.com (i.e. user-1234-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org, where 1234 is the user id in the database) into rails via the mailer''s receive method. Now, the idea is to first check that the sender''s
2005 Mar 29
0
ActionMailer tmail/quoting.rb problem
Hi, Why did you allow this incompatibility? ;) * fixtures/notifications/signup: _foo @expected.body = read_fixture(''signup'') p @expected.body #=> " foo\n" # because text.gsub(/_/," ") If you enhance TMail::Mail#body like this, I want you to convert mail.body code in render_body. My mailer code now: # topic is a ActiveRecord instance. topic
2009 Jan 13
0
optional authentication and HTTP Basic
Hi all, I have an app that originally only supported form-based authentication, and showed pared-down content to unauthenticated users. I then layered on HTTP Basic authentication using authenticate_with_http_basic, which worked fine for scripts like LWP/ wget/curl. However, some web browsers refuse to submit credentials in the URL (eg.
2010 Aug 10
3
ActiveRecord::UnknownAttributeError: unknown attribute: <script type
Has anyone seen this happening to their apps? I''m starting to get errors like this come across from one of my apps: ActiveRecord::UnknownAttributeError: unknown attribute: <script type The parameters being sent are: {"user"=> {"email_confirmation"=>"someone-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org",
2016 Jun 14
2
Double variable expansion / multiple password mechanisms
Hi Karsten, > You should be able to add multiple userPassword attributes to your directory: > > userPassword: {CRAM-MD5}xxx > userPassword: {DIGEST-MD5}xxxx > userPassword: {SCRAM-SHA-1}xxxx > userPassword: {NTLM}xxxx > > > Karsten Did try this, didn't end end well. Jun 14 12:59:43 auth: Error: ldap(leonkyneur at itest.com,192.168.99.3,<SQn6QD41TpvLhgGR>):
2012 Feb 11
1
rake command shows the error
rails -v=2.3.8 gem -v= 1.4.2 ruby -v=1.8.7 When i issue the "rake" command ,it gives the following error . (in /home/amrit/amrit/OSV/OpenStreetView) /usr/bin/ruby1.8 -I"lib:test" "/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/functional/main_controller_test.rb" "test/functional/upload_controller_test.rb"
2011 May 03
1
syntax error, unexpected $end, expecting rASSOC
I added this to my db/seeds.rb: user = User.create :email => ''another-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org'', "password => ''guessit'' Category.create [{:name => ''Programming''}, {:name => ''Event''}, {:name => ''Travel''}, {:name => ''Music''},
2011 Mar 04
1
How to modify the template path for ActionMailer used in a Ruby script ?
I am testing a ruby 1.9.2 script (it''ll be run in a cron task later...) in which I am trying to use ActionMailer All my files are in a single folder ''joinus_email - joinus_email joinus_email.rb notifier.rb - notifications joinus_email.html.erb joinus_email.text.erb running the script joinus_email.rb, (in which I defined the
2012 Nov 17
0
How to get more debug information in test log ?
Im one of my unit tests, I got an error I cannot even start looking for the issue as few information are logged ... Using the test console , there is no error at all : > rails console test >> Loading test environment (Rails 3.2.9.rc3) > site1 = FactoryGirl.create(:cms_site, label: "booboo") >> BEGIN .. .. >> but running my tests > unit > ruby -Itest
2006 Feb 11
0
Dovecot pop3s problem : can't see email
Hi. I am trying to setup dovecot running a pop3 service for external clients (and intend in future to setup an imap interface on localhost only for squirrelmail.) Exim is delivering ok to local mailboxes, but I can't seem to get dovecot to serve them. Configuration details: ---------------------- All users run as the tst user, and authentication is done through postgresql. ...excerpt...
2011 Oct 15
0
shoulda installation troubles
I cannot manage to have shoulda working. I''m using rvm with rails 3.1 and ruby 1.9.2 I added group :test do gem "shoulda" end to the Gemfile, and then run bundle install, thus the gem is installed, and it is featured in the list running gem list --local. but whenever I add something like class ModelTest < Test::Unit::TestCase should_not
2010 Nov 08
0
Rails3: "rake test" task does not run tests.
Hello all, I have a spiffy new rails3 app for which I can run tests individually, but not via rake. Behold! > $ ruby -Itest test/unit/test_user.rb > Loaded suite test/unit/test_user > Started > . > Finished in 0.466033 seconds. > > 1 tests, 1 assertions, 0 failures, 0 errors, 0 skips > > Test run options: --seed 21789 and > $ rake test:units --trace > (in
2012 May 24
0
Ruby on Rails Tutorial Chapter 6 RSpec tests failing
Hello all: I''m a RoR newbie who is currently following the Ruby on Rails Tutorial: Learning by Example book (http://ruby.railstutorial.org/ chapters/modeling-users#sec:adding_a_secure_password). The following Chapter 6 RSpec tests are failing: Failures: 1) User [31mFailure/Error:[0m [31mit { should be_valid }[0m [31mexpected valid? to return true, got false[0m [36m # ./spec/models/
2010 Nov 05
0
RoR:OSV: Installation issue
I am trying to get a local installation of OpenStreetView, on Ubuntu 10.10 On installing Rails (2.3.8) and OSV code using git, when I issue "rake" command, I get response, which is reproduced below signature. What is missing from my installation? -- .O.C. $ rake (in /home/meet/OSV/OpenStreetView) /usr/bin/ruby1.8 -I"lib:test" "/var/lib/gems/1.8/gems/rake-0.8.7/lib/