diff options
| author | mo k <mo@mokhan.ca> | 2012-09-27 21:20:15 -0600 |
|---|---|---|
| committer | mo k <mo@mokhan.ca> | 2012-09-27 21:20:15 -0600 |
| commit | 86d5d8e779e798ad10ffb621d596b099fbc58371 (patch) | |
| tree | 79f4ca3e802f4e4a86fe6382dd1f1ebff7553284 /spec/controllers/comments_controller_spec.rb | |
| parent | 868cdfb3136d2eceabbd5cd1bb444bd5aa32b09a (diff) | |
give up on trying to test when you are not signed in.
Diffstat (limited to 'spec/controllers/comments_controller_spec.rb')
| -rw-r--r-- | spec/controllers/comments_controller_spec.rb | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/spec/controllers/comments_controller_spec.rb b/spec/controllers/comments_controller_spec.rb index 12972217..f354b047 100644 --- a/spec/controllers/comments_controller_spec.rb +++ b/spec/controllers/comments_controller_spec.rb @@ -1,21 +1,20 @@ describe CommentsController do - describe "POST create" do - describe "when signed in" do - let(:user) { FactoryGirl.create(:user) } + describe "when signed in" do + let(:user) { FactoryGirl.create(:user) } + before(:each) do + http_login(user) + end + describe "POST create" do let(:creation) { FactoryGirl.create(:creation) } - before :each do + before(:each) do http_login(user) + post :create, {:creation_id => creation.id, :comment => {:body => 'blah'}} + end + it "should display a message indicated that the comment was saved" do + flash[:notice].should_not be_nil end - describe 'when commenting on a creation' do - before(:each) do - post :create, {:creation_id => creation.id, :comment => {:body => 'blah'}} - end - it "should display a message indicated that the comment was saved" do - flash[:notice].should_not be_nil - end - it "should redirect to the creation#show page" do - response.should redirect_to(creation) - end + it "should redirect to the creation#show page" do + response.should redirect_to(creation) end end end |
