I have a simple rspec test which is failing in after i upgrade to
3.2.6.

here is the spec in users_controller_spec.rb

describe "show action" do
before(:each) do
User.stub!(:find).with(@user.id).and_return(@user)
end

def do_get
get :show, :id => @user.id
end

it "should be successful" do
do_get
response.should be_success
end
end

and here is the error
1) UsersController show action should be successful Failure/Error:
get :show, :id => @user.id ......................... (class)>
received :find with unexpected arguments expected: (2) got: ("2")

Not sure where is going wrong. The show action has nothing in the
controller, it is just def show end

--
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-US.

Search Discussions

  • Oscar Del Ben at Jul 3, 2012 at 2:10 pm
    it looks like parameters are now passed as strings.

    --
    Oscar Del Ben
    Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

    On Tuesday, July 3, 2012 at 4:21 AM, venkata reddy wrote:

    I have a simple rspec test which is failing in after i upgrade to
    3.2.6.

    here is the spec in users_controller_spec.rb

    describe "show action" do
    before(:each) do
    User.stub!(:find).with(@user.id).and_return(@user)
    end

    def do_get
    get :show, :id => @user.id
    end

    it "should be successful" do
    do_get
    response.should be_success
    end
    end

    and here is the error
    1) UsersController show action should be successful Failure/Error:
    get :show, :id => @user.id ......................... (class)>
    received :find with unexpected arguments expected: (2) got: ("2")

    Not sure where is going wrong. The show action has nothing in the
    controller, it is just def show end

    --
    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 (mailto:rubyonrails-talk@googlegroups.com).
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com (mailto:rubyonrails-talk+unsubscribe@googlegroups.com).
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.

    --
    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-US.
  • Colin Law at Jul 3, 2012 at 2:33 pm

    On 3 July 2012 12:21, venkata reddy wrote:
    I have a simple rspec test which is failing in after i upgrade to
    3.2.6.

    here is the spec in users_controller_spec.rb

    describe "show action" do
    before(:each) do
    User.stub!(:find).with(@user.id).and_return(@user)
    end

    def do_get
    get :show, :id => @user.id
    end

    it "should be successful" do
    do_get
    response.should be_success
    end
    end

    and here is the error
    1) UsersController show action should be successful Failure/Error:
    get :show, :id => @user.id ......................... (class)>
    received :find with unexpected arguments expected: (2) got: ("2")
    How are you setting up @user.id in your tests? Is it possible that it
    is a string rather than an integer?

    Colin

    --
    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-US.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJul 3, '12 at 11:22a
activeJul 3, '12 at 2:33p
posts3
users3
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2022 Grokbase