Created
July 2, 2010 17:55
-
-
Save trobrock/461667 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe CardsController, "for a logged in user" do | |
before(:each) do | |
@cardset = Factory(:cardset) | |
profile = @cardset.profile | |
controller.stubs(:require_user).returns(true) | |
controller.stubs(:current_user).returns(profile) | |
end | |
context "and created card" do | |
before(:each) do | |
@card = Factory(:card) | |
end | |
context "with get to show" do | |
context "with valid cardset" do | |
before(:each) do | |
Cardset.any_instance.stubs(:find_by_id).returns(@cardset) | |
Card.any_instance.stubs(:find_by_id).returns(@card) | |
get :show, :cardset_id => @cardset.id, :id => @card.id | |
end | |
it "should assign card" do | |
assigns[:card].should_not be_nil | |
end | |
it "should assign cardset" do | |
assigns[:cardset].should_not be_nil | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment