fix the cucumber tests for pages
This commit is contained in:
parent
4269a00985
commit
ecf6998a68
@ -23,13 +23,12 @@ Scenario: Creating a valid page
|
|||||||
Then I should see "Page was successfully created."
|
Then I should see "Page was successfully created."
|
||||||
And I should have "{% extends 'parent' %}" in the test page
|
And I should have "{% extends 'parent' %}" in the test page
|
||||||
|
|
||||||
@wip
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: Updating a valid page
|
Scenario: Updating a valid page
|
||||||
When I go to pages
|
When I go to pages
|
||||||
And I follow "Home page"
|
And I follow "Home page"
|
||||||
And I fill in "page_title" with "Home page !"
|
And I change the page title with "Home page !"
|
||||||
And I fill in "Raw template" with "My new content is here"
|
And I change the page template with "My new content is here"
|
||||||
And I press "Save"
|
And I press "Save"
|
||||||
Then I should see "Page was successfully updated."
|
Then I should see "Page was successfully updated."
|
||||||
And I should have "My new content is here" in the index page
|
And I should have "My new content is here" in the index page
|
||||||
|
@ -17,6 +17,17 @@ Given /^a page named "([^"]*)" with the template:$/ do |page_slug, template|
|
|||||||
@page = create_content_page(page_slug, '', template)
|
@page = create_content_page(page_slug, '', template)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# change the title
|
||||||
|
When /^I change the page title with "([^"]*)"$/ do |page_title|
|
||||||
|
page.evaluate_script "window.prompt = function() { return '#{page_title}'; }"
|
||||||
|
page.find('h2 a.editable').click
|
||||||
|
end
|
||||||
|
|
||||||
|
# change the template
|
||||||
|
When /^I change the page template with "([^"]*)"$/ do |page_template|
|
||||||
|
page.evaluate_script "window.application_view.view.model.set({ 'raw_template': '#{page_template}' })"
|
||||||
|
end
|
||||||
|
|
||||||
# update a page
|
# update a page
|
||||||
When /^I update the "([^"]*)" page with the template:$/ do |page_slug, template|
|
When /^I update the "([^"]*)" page with the template:$/ do |page_slug, template|
|
||||||
page = @site.pages.where(:slug => page_slug).first
|
page = @site.pages.where(:slug => page_slug).first
|
||||||
|
Loading…
Reference in New Issue
Block a user