Thursday, February 16, 2012

[Rails] Upgrading from 3.2.0 to 3.2.1: Wrong Number of Arguments

Simple spec passes in 3.2.0:

it "destroys an album" do
3.times { Factory(:album, photo_library: @photo_library) }
visit photo_library_path(@photo_library)
find("h3").click_link 'Delete'
find("#notice").should have_content("Album deleted successfully")
Album.count.should eq 2
end

But fails in 3.2.1 with:

1) Albums destroys an album
Failure/Error: login_admin
ArgumentError:
wrong number of arguments (0 for 1)
# ./app/controllers/sessions_controller.rb:8:in `create'
# (eval):2:in `click_button'
# ./spec/requests/albums_spec.rb:7:in `block (2 levels) in <top
(required)>'

Line 8 in sessions_controller is:

user = User.find_by_email(params[:email])


What's going on here? Here's the diff in the Gemfile.lock after making
the upgrade:

- actionmailer (3.2.0)
- actionpack (= 3.2.0)
+ actionmailer (3.2.1)
+ actionpack (= 3.2.1)
- actionpack (3.2.0)
- activemodel (= 3.2.0)
- activesupport (= 3.2.0)
+ actionpack (3.2.1)
+ activemodel (= 3.2.1)
+ activesupport (= 3.2.1)
- journey (~> 1.0.0)
+ journey (~> 1.0.1)
- activemodel (3.2.0)
- activesupport (= 3.2.0)
+ activemodel (3.2.1)
+ activesupport (= 3.2.1)
- activerecord (3.2.0)
- activemodel (= 3.2.0)
- activesupport (= 3.2.0)
+ activerecord (3.2.1)
+ activemodel (= 3.2.1)
+ activesupport (= 3.2.1)
- activeresource (3.2.0)
- activemodel (= 3.2.0)
- activesupport (= 3.2.0)
- activesupport (3.2.0)
+ activeresource (3.2.1)
+ activemodel (= 3.2.1)
+ activesupport (= 3.2.1)
+ activesupport (3.2.1)

- rails (3.2.0)
- actionmailer (= 3.2.0)
- actionpack (= 3.2.0)
- activerecord (= 3.2.0)
- activeresource (= 3.2.0)
- activesupport (= 3.2.0)
+ rails (3.2.1)
+ actionmailer (= 3.2.1)
+ actionpack (= 3.2.1)
+ activerecord (= 3.2.1)
+ activeresource (= 3.2.1)
+ activesupport (= 3.2.1)
- railties (= 3.2.0)
- railties (3.2.0)
- actionpack (= 3.2.0)
- activesupport (= 3.2.0)
+ railties (= 3.2.1)
+ railties (3.2.1)
+ actionpack (= 3.2.1)
+ activesupport (= 3.2.1)
- rails (= 3.2.0)
+ rails (= 3.2.1)

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate