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

[1594] Refactor Requirements Controller Spec - #1619

Open
esoterik wants to merge 2 commits into
masterfrom
1594_refactor_req_controller_spec
Open

[1594] Refactor Requirements Controller Spec#1619
esoterik wants to merge 2 commits into
masterfrom
1594_refactor_req_controller_spec

Conversation

@esoterik

@esoterik esoterik commented Aug 4, 2016

Copy link
Copy Markdown
Collaborator

Resolves #1594

@esoterik
esoterik force-pushed the 1594_refactor_req_controller_spec branch from b9ce89b to e23bf23 Compare August 9, 2016 14:16
sign_in FactoryGirl.create(:user)
get :show, id: @requirement
expect(response).to redirect_to(root_url)
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is testing for show removed?

sign_in FactoryGirl.create(:admin)
get :edit, id: @requirement
end
it 'should set @requirement to the selected requirement' do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume removed because the route doesn't get used?

mock_user_sign_in
put :update, id: 1, requirement: { contact_name: 'Name' }
end
it_behaves_like 'redirected request'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't check permissions, since a successful request will also redirect

mock_user_sign_in
delete :destroy, id: 1
end
it_behaves_like 'redirected request'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also doesn't check permissions, for same reason

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants