Guest User

Untitled

a guest
Jul 16th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. context "handle :create" do
  2. setup do
  3. @author = logged_in_role(:normal).racf
  4. @request.env['SM_USER'] = @author
  5. post :create, :investigation => Factory.attributes_for(:investigation, :author_racf => @author)
  6. end
  7.  
  8. should_assign_to :investigation
  9. should_redirect_to("investigation_url(@investigation)") {investigation_url(Investigation.last)}
  10.  
  11. end
  12.  
  13. test "should create investigation" do
  14. @request.env["SM_USER"] = "da12345"
  15. assert_difference('Investigation.count') do
  16. post :create, :investigation => {:author_racf => 'da12345',
  17. :description => 'blat',
  18. :priority_id => 1}
  19. end
  20.  
  21. assert_redirected_to investigation_path(assigns(:investigation))
  22. end
Add Comment
Please, Sign In to add comment