Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Fw: assign_to failing in Rails 3 / RSpec 2 / Shoulda 2.11.3 (Expected action to assign a value for @var)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mikael Henriksson  
View profile  
 More options Mar 6 2011, 1:58 pm
From: Mikael Henriksson <mik...@zoolutions.se>
Date: Sun, 6 Mar 2011 19:58:51 +0100
Local: Sun, Mar 6 2011 1:58 pm
Subject: Fw: assign_to failing in Rails 3 / RSpec 2 / Shoulda 2.11.3 (Expected action to assign a value for @var)

Forwarded message:

> Ok, full code comming up
> context "as admin" do
> before do
> user = Factory(:admin)
> @orders = []
> 10.times do
> @orders << Factory(:order)
> end
> sign_in user
> User.current = user
> controller.stubs(:current_user).returns(user)
> Order.stubs(:all_for_index).returns(@orders)

> get :index
> end

> subject { controller }

> it { should assign_to(:orders) } #this does not work
> # this works fine
> it "should assign to orders" do
> assigns[:orders].should == @orders
> end
> it { should respond_with(:success) }
> it { should respond_with_content_type(:html) }
> it { should render_template(:index) }
> it { should_not set_the_flash }
> end


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.