Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- context "Adding a fresh user" do
- fixtures :users, :roles, :rights
- controller_name :account
- setup do
- roles(:admin).rights << rights(:admin)
- users(:rod).roles << roles(:admin)
- @session[:user] = users('rod').id
- post 'add_user', :realname => 'Randy Woolman', :username => 'randy', :contact => 'home', :password => 'woolman', :password_confirmation => 'woolman'
- end
- specify "should create a new user" do
- User.should_exist :username => 'randy'
- end
- specify "should show & hide status" do
- response.should_have_rjs :effect, :appear, 'status'
- response.should_have_rjs :effect, :fade, 'status'
- end
- specify "should inform of a successfull add" do
- response.should_have_rjs :replace_html, 'status', /User added/
- end
- specify "should hide errors" do
- response.should_have_rjs :effect, :blind_up, 'errors'
- end
- specify "should hide add form" do
- response.should_have_rjs :effect, :blind_up, 'addUserForm'
- end
- specify "should update user list" do
- response.should_have_rjs :replace_html, 'userData'
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement