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

Commit b9ce89b

Browse files
author
Sydney Young
committed
use successful request shared example
1 parent 6d8358b commit b9ce89b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

spec/controllers/requirements_controller_spec.rb

+2-6
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
mock_user_sign_in(UserMock.new(:admin))
1212
get :index
1313
end
14-
it { is_expected.to respond_with(:success) }
15-
it { is_expected.to render_template(:index) }
16-
it { is_expected.not_to set_flash }
14+
it_behaves_like 'successful request', :index
1715
it 'should populate an array of all requirements' do
1816
expect(Requirement).to have_received(:all).twice
1917
end
@@ -34,9 +32,7 @@
3432
mock_user_sign_in(UserMock.new(:admin))
3533
get :new
3634
end
37-
it { is_expected.to respond_with(:success) }
38-
it { is_expected.to render_template(:new) }
39-
it { is_expected.not_to set_flash }
35+
it_behaves_like 'successful request', :new
4036
it 'assigns a new requirement to @requirement' do
4137
expect(Requirement).to have_received(:new).twice
4238
end

0 commit comments

Comments
 (0)