Skip to content
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.

Commit

Permalink
use successful request shared example
Browse files Browse the repository at this point in the history
  • Loading branch information
Sydney Young committed Aug 4, 2016
1 parent 6d8358b commit b9ce89b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions spec/controllers/requirements_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
mock_user_sign_in(UserMock.new(:admin))
get :index
end
it { is_expected.to respond_with(:success) }
it { is_expected.to render_template(:index) }
it { is_expected.not_to set_flash }
it_behaves_like 'successful request', :index
it 'should populate an array of all requirements' do
expect(Requirement).to have_received(:all).twice
end
Expand All @@ -34,9 +32,7 @@
mock_user_sign_in(UserMock.new(:admin))
get :new
end
it { is_expected.to respond_with(:success) }
it { is_expected.to render_template(:new) }
it { is_expected.not_to set_flash }
it_behaves_like 'successful request', :new
it 'assigns a new requirement to @requirement' do
expect(Requirement).to have_received(:new).twice
end
Expand Down

0 comments on commit b9ce89b

Please sign in to comment.