Skip to content

Commit

Permalink
More refactoring to centralise our model instantiation steps
Browse files Browse the repository at this point in the history
  • Loading branch information
baphled committed Jul 5, 2010
1 parent 563f033 commit 19c45a9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 4 additions & 4 deletions features/enhanced/hover_functionality.feature
Expand Up @@ -12,7 +12,7 @@ Feature: Hovering over a project item

Scenario: Hovering over a project item from project feature
Given the "project" has "features"
When I visit the projects features
When I visit the "projects" "features"
And the feature page is loaded
And the first feature is hovered over
Then the feature's information will be display in the sidebar
Expand All @@ -32,14 +32,14 @@ Feature: Hovering over a project item
Then the story's information will be display in the sidebar

Scenario: When viewing a project we must be able to hover of its items
Given the project has features
Given the "project" has "features"
And the project is viewed
And the first feature is hovered over
Then the feature's information will be display in the sidebar

Scenario: When viewing a project's feature we must be able to hover of its items
Given the project has features
When I visit the projects features
Given the "project" has "features"
When I visit the "projects" "features"
And the first feature is hovered over
Then the feature's information will be display in the sidebar

Expand Down
12 changes: 11 additions & 1 deletion features/step_definitions/projects_steps.rb
Expand Up @@ -81,7 +81,7 @@
when /project/
@project = Project.find 2
else
raise "Can't find model from \"#{model}\" to a path.\n" +
raise "Can't instantiate \"#{model}\".\n" +
"Now, go and add a mapping in #{__FILE__}"
end
end
Expand Down Expand Up @@ -123,6 +123,16 @@
visit import_feature_project_path @project
end

When /^I visit the "([^\"]*)" "([^\"]*)"$/ do |model, assoc|
case model
when /projects/
visit features_project_path @project
else
raise "Unable to find path for \"#{model}\" associated to \"#{assoc}\".\n" +
"Now, go and add a mapping in #{__FILE__}"
end
end

Then /^submit the form$/ do
click_button 'save'
end
Expand Down

0 comments on commit 19c45a9

Please sign in to comment.