fixing cucumber tests (wip)

This commit is contained in:
Didier Lafforgue 2012-02-17 01:16:22 +01:00
parent 085a54d7c1
commit 4269a00985
5 changed files with 16 additions and 15 deletions

View File

@ -10,19 +10,21 @@ Background:
Scenario: Pages list is not accessible for non authenticated accounts
Given I am not authenticated
When I go to pages
Then I should see "Log in"
Then I should see "You need to sign in or sign up before continuing"
@javascript
Scenario: Creating a valid page
When I go to pages
And I follow "new page"
And I fill in "page_title" with "Test"
And I fill in "Slug" with "test"
And I select "Home page" from "Parent"
And I fill in "Raw template" with "Lorem ipsum...."
And I press "Create"
Then I should see "Page was successfully created."
And I should have "Lorem ipsum...." in the test page
And I should have "{% extends 'parent' %}" in the test page
@wip
@javascript
Scenario: Updating a valid page
When I go to pages
And I follow "Home page"

View File

@ -10,7 +10,7 @@ Background:
Scenario: Site settings are not accessible for non authenticated accounts
Given I am not authenticated
When I go to the site settings
Then I should see "Log in"
Then I should see "You need to sign in or sign up before continuing"
Scenario: Add a new site
Given I go to the account settings

View File

@ -15,7 +15,6 @@ Background:
"yield"
"""
Scenario: Creating a Snippet
When I go to theme assets
And I follow "new snippet"

View File

@ -1,7 +1,7 @@
### Authentication
Given /^I am not authenticated$/ do
visit('/admin/sign_out')
visit('/locomotive/sign_out')
end
Given /^I am an authenticated "([^"]*)"$/ do |role|

View File

@ -17,27 +17,27 @@ module NavigationHelpers
when /logout/
destroy_locomotive_account_session_url
when /pages( list)?/
locomotive_pages_path
pages_path
when /new page/
new_locomotive_page_path
new_page_path
when /"(.*)" edition page/
page = Site.first.pages.where(:slug => $1).first
edit_locomotive_page_path(page)
edit_page_path(page)
when /theme assets/
locomotive_theme_assets_path
theme_assets_path
when /site settings/
edit_locomotive_current_site_path
edit_current_site_path
when /account settings/
edit_locomotive_my_account_path
edit_my_account_path
when /the "(.*)" model list page/
content_type = Locomotive::Site.first.content_types.where(:name => $1).first
locomotive_contents_path(content_type.slug)
content_entries_path(content_type.slug)
when /the "(.*)" model creation page/
content_type = Locomotive::Site.first.content_types.where(:name => $1).first
new_locomotive_content_path(content_type.slug)
new_content_entry_path(content_type.slug)
when /the "(.*)" model edition page/
content_type = Locomotive::Site.first.content_types.where(:name => $1).first
edit_locomotive_content_type_path(content_type)
edit_content_entries_path(content_type)
# Add more mappings here.
# Here is an example that pulls values out of the Regexp: