Advertisement
Guest User

Untitled

a guest
Jul 31st, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. context "Adding a fresh user" do
  2. fixtures :users, :roles, :rights
  3. controller_name :account
  4.  
  5. setup do
  6. roles(:admin).rights << rights(:admin)
  7. users(:rod).roles << roles(:admin)
  8. @session[:user] = users('rod').id
  9. post 'add_user', :realname => 'Randy Woolman', :username => 'randy', :contact => 'home', :password => 'woolman', :password_confirmation => 'woolman'
  10. end
  11.  
  12. specify "should create a new user" do
  13. User.should_exist :username => 'randy'
  14. end
  15.  
  16. specify "should show & hide status" do
  17. response.should_have_rjs :effect, :appear, 'status'
  18. response.should_have_rjs :effect, :fade, 'status'
  19. end
  20.  
  21. specify "should inform of a successfull add" do
  22. response.should_have_rjs :replace_html, 'status', /User added/
  23. end
  24.  
  25. specify "should hide errors" do
  26. response.should_have_rjs :effect, :blind_up, 'errors'
  27. end
  28.  
  29. specify "should hide add form" do
  30. response.should_have_rjs :effect, :blind_up, 'addUserForm'
  31. end
  32.  
  33. specify "should update user list" do
  34. response.should_have_rjs :replace_html, 'userData'
  35. end
  36.  
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement