Skip to content

Commit

Permalink
I totally cuked on the plane today.
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Jul 26, 2010
1 parent 7baae7a commit 6e7e038
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
28 changes: 25 additions & 3 deletions features/refinery/manage_inquiries.feature
@@ -1,4 +1,26 @@
Feature: Manage Inquiries
In order to control the content on my website
As an administrator
I want to create and manage inquiries
In order to contact the website owner
I want to create an inquiry

Background:
Given A Refinery user exists
And I have a page titled "Contact Us" with a custom url "/contact"
And I have a page titled "Thank You" with a custom url "/contact/thank_you"

Scenario: Contact page
When I go to the contact page
Then I should see "Name *"
And I should see "Email *"
And I should see "Phone"
And I should see "Message *"

Scenario: Create a valid inquiry
When I go to the contact page
And I fill in "Name *" with "Philip"
And I fill in "Email *" with "phil@refinerycms.com"
And I fill in "Message *" with "It sure is good to have a functional test coverage."
And I press "Send"
Then I should be on the contact thank you page
And I should see "Thank You"
And I should see "received your inquiry"
And I should see "Return to the home page"
2 changes: 1 addition & 1 deletion features/refinery/site_bar.feature
Expand Up @@ -4,7 +4,7 @@ Feature: Site Bar
And I want logged in customers to not see a site bar

Background:
Given I have a home page titled "Home"
Given I have a page titled "Home" with a custom url "/"
And I am not logged in

Scenario: Not logged in
Expand Down
10 changes: 4 additions & 6 deletions features/step_definitions/refinery/page_steps.rb
@@ -1,10 +1,8 @@
Given /^I (only )?have a (home )?page titled (.+)$/ do |only, home, title|
Given /^I (only )?have a page titled (.+) with a custom url (.+)?$/ do |only, title, link_url|
Page.delete_all if only
unless home
Page.create(:title => title)
else
Page.create(:title => title, :link_url => '/')
end

Page.create(:title => title,
:link_url => link_url)
end

Given /^I (only )?have pages titled (.+)$/ do |only, titles|
Expand Down
6 changes: 6 additions & 0 deletions features/support/paths.rb
Expand Up @@ -17,6 +17,12 @@ def path_to(page_name)
when /the list of users/
admin_users_path

when /the contact page/
new_inquiry_path

when /the contact thank you page/
thank_you_inquiries_path

# Add more mappings here.
# Here is an example that pulls values out of the Regexp:
#
Expand Down

0 comments on commit 6e7e038

Please sign in to comment.