Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 5 commits
  • 10 files changed
  • 0 commit comments
  • 1 contributor
View
0 features/admin_access.feature → capybara_features/admin_access.feature
File renamed without changes.
View
0 features/admin_page_link.feature → capybara_features/admin_page_link.feature
File renamed without changes.
View
0 features/editing_contact_info.feature → ...ara_features/editing_contact_info.feature
File renamed without changes.
View
0 features/home_page_link.feature → capybara_features/home_page_link.feature
File renamed without changes.
View
0 features/sidebar_links.feature → capybara_features/sidebar_links.feature
File renamed without changes.
View
10 capybara_features/step_definitions/database_steps.rb
@@ -14,14 +14,10 @@
Given %(a #{user_type} "#{user_name}" with password "123")
end
-Given /^I am logged in as "(.+)"/ do |user_name|
- @session = Session.for_user(User.find_by_user_name(user_name), nil)
- @session.save!
- @session.put_in_cookie cookies
-end
-
Given /^I have an expired session/ do
- @session.destroy
+ Session.all.each do |session|
+ session.destroy
+ end
end
Given /^user "(.+)" is disabled$/ do |username|
View
6 capybara_features/step_definitions/login_steps.rb
@@ -14,6 +14,12 @@
Given "I press \"Log in\""
end
+Given /^I am logged in as "(.+)"/ do |user_name|
+ Given "I am on the login page"
+ Given "I fill in \"#{user_name}\" for \"user_name\""
+ Given "I fill in \"123\" for \"password\""
+ Given "I press \"Log in\""
+end
Given /there is a User/ do
View
13 capybara_features/step_definitions/more_web_steps.rb
@@ -65,3 +65,16 @@ def with_scope(locator)
Then /^the field "([^"]*)" should have the following options:$/ do |locator, table|
page.should have_select(locator, :options => table.raw.flatten)
end
+
+Then /^(?:|I )should see a link to the (.+)$/ do |page_name|
+ page.find(:xpath, "//a[@href=\"#{path_to(page_name)}\"] ")
+end
+
+Then /^I should not be able to see (.+)$/ do |page_name|
+ lambda { visit path_to(page_name) }.should raise_error(AuthorizationFailure)
+end
+
+Then /^I should be able to see (.+)$/ do |page_name|
+ When "I go to #{page_name}"
+ Then "I should be on #{page_name}"
+end
View
2 capybara_features/step_definitions/web_steps.rb
@@ -9,7 +9,7 @@
module WithinHelpers
def with_scope(locator)
- locator ? within(locator) { yield } : yield
+ locator ? within(:css, locator) { yield } : yield
end
end
World(WithinHelpers)
View
1 features/webapp_authentication.feature → ...ra_features/webapp_authentication.feature
@@ -6,6 +6,5 @@ Feature: Only users should be allowed to access the system
Given "Lawrence" is the user
And I am logged in as "Lawrence"
And I have an expired session
-
When I go to the home page
And I should see "invalid session token"

No commit comments for this range

Something went wrong with that request. Please try again.