migrate feedlist, user password, loggin in, manage users, mobile_* and notes manage

This commit is contained in:
Reinier Balt 2012-02-21 20:18:26 +01:00
parent d8b5c7d0d2
commit d528a87cee
10 changed files with 88 additions and 63 deletions

View file

@ -35,9 +35,9 @@ Given /^the following user records with hash algorithm$/ do |table|
end
When /^I change my password to "([^"]*)"$/ do |password|
Then 'I should be on the change password page'
step 'I should be on the change password page'
%w{password password_confirmation}.each { |name| fill_in "user[#{name}]", :with => password }
click_button
click_button "Change password"
end
Given "no users exists" do
@ -50,19 +50,21 @@ When /^I delete the user "([^\"]*)"$/ do |username|
user = User.find_by_login(username)
user.should_not be_nil
selenium.click "xpath=//tr[@id='user-#{user.id}']//img"
selenium.get_confirmation.should == "Warning: this will delete user '#{user.login}', all their actions, contexts, project and notes. Are you sure that you want to continue?"
wait_for do
!selenium.is_element_present("//tr[@id='user-#{user.id}']//img")
handle_js_confirm do
page.find(:xpath, "//tr[@id='user-#{user.id}']//img").click
end
get_confirm_text.should == "Warning: this will delete user '#{user.login}', all their actions, contexts, project and notes. Are you sure that you want to continue?"
wait_until do
!page.has_css?("tr#user-#{user.id}")
end
end
Then /^I should see that a user named "([^\"]*)" is not present$/ do |username|
Then "I should not see \"#{username} (\""
step "I should not see \"#{username} (\""
end
Then "I should be an admin" do
# just check on the presence of the menu item for managing users
Then "I should see \"Manage users\""
step "I should see \"Manage users\""
end