Skip to content

Commit

Permalink
Added steps and specs for implementing our feature download functiona…
Browse files Browse the repository at this point in the history
…lity.
  • Loading branch information
baphled committed Jul 6, 2010
1 parent bd13f9c commit f0f221c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
10 changes: 9 additions & 1 deletion features/plain/feature_export.feature
Expand Up @@ -35,4 +35,12 @@ Feature: A user needs to be able to export created features into cucumber featur
Scenario: We want to be able to export the feature in a RESTful manner
Given there is a feature
When we view the feature with the "feature" format
Then the feature should be displayed
Then the feature should be displayed

Scenario: Saving the exported feature
Given there is a feature
When I view the "export feature" path
Then a "Download" button should be displayed



6 changes: 6 additions & 0 deletions features/step_definitions/navigations_steps.rb
Expand Up @@ -29,4 +29,10 @@

Then /^the "([^\"]*)" will be selected$/ do |menu_item|
response.should have_selector :li, attribute = {:class => 'selected', :id => menu_item}
end

Then /^a "([^\"]*)" button should be displayed$/ do |arg1|
response.should have_selector :button do |content|
content.should contain 'Download'
end
end
2 changes: 1 addition & 1 deletion features/support/paths.rb
Expand Up @@ -11,7 +11,7 @@ def path_to(page_name)
when /the home\s?page/
'/'
when /export feature/
'/features/1/export'
export_feature_path(@feature)
when /import project/
import_project_path(@project)
when /feature changes/
Expand Down
4 changes: 4 additions & 0 deletions spec/views/features/export.html.erb_spec.rb
Expand Up @@ -11,5 +11,9 @@
it "should have display a title" do
response.should contain "Exported feature:"
end

it "has a download link" do
response.should have_selector :button, :contents => 'Download'
end
end
end

0 comments on commit f0f221c

Please sign in to comment.