Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- context "handle :create" do
- setup do
- @author = logged_in_role(:normal).racf
- @request.env['SM_USER'] = @author
- post :create, :investigation => Factory.attributes_for(:investigation, :author_racf => @author)
- end
- should_assign_to :investigation
- should_redirect_to("investigation_url(@investigation)") {investigation_url(Investigation.last)}
- end
- test "should create investigation" do
- @request.env["SM_USER"] = "da12345"
- assert_difference('Investigation.count') do
- post :create, :investigation => {:author_racf => 'da12345',
- :description => 'blat',
- :priority_id => 1}
- end
- assert_redirected_to investigation_path(assigns(:investigation))
- end
Add Comment
Please, Sign In to add comment