Skip to content

Commit

Permalink
Removal of all unused steps.
Browse files Browse the repository at this point in the history
  • Loading branch information
baphled committed Jul 25, 2010
1 parent c7cb52a commit 6e41692
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 90 deletions.
12 changes: 0 additions & 12 deletions features/step_definitions/feature_export_steps.rb
Expand Up @@ -3,13 +3,6 @@
Feature.stub!(:find).and_return @feature
end

Given /^we select a feature with stories$/ do
@steps = []
3.times { |steps| @steps << Step.make }
@feature.stories << Story.make(:steps => [@steps])
Feature.stub!(:find).and_return @feature
end

Given /^the feature has a story with no steps$/ do
@has_no_steps = Story.make
@feature.stories << @has_no_steps
Expand All @@ -34,11 +27,6 @@
response.should_not have_selector :a, attribute = {:href => "#{export_feature_path @feature}"}
end

Then /^the feature should be converted to the necessary cucumber feature format$/ do
@file = File.open("#{RAILS_ROOT}/spec/fixtures/test.feature")
response.should contain "Scenario: #{@feature.stories.first.scenario}"
end

Then /^that story is not added to the exported feature$/ do
response.should_not contain "Scenario: #{@has_no_steps.scenario}"
end
4 changes: 0 additions & 4 deletions features/step_definitions/feature_import_steps.rb
Expand Up @@ -2,10 +2,6 @@
Given %{we have a valid feature file}
end

Given /^the project has a project path$/ do
@project.update_attribute(:location,"#{RAILS_ROOT}/spec/fixtures")
end

Given /^there are no projects to import$/ do
Feature.stub!(:find_by_path).and_return mock_model(Feature).as_null_object
end
Expand Down
8 changes: 0 additions & 8 deletions features/step_definitions/features_steps.rb
Expand Up @@ -81,14 +81,6 @@
end
end

Then /^the feature should be not associated to the first story$/ do
@feature.stories.should_not contain Feature.first.stories.first
end

Then /^the feature information should be not saved$/ do
response.should_not contain "was created"
end

Then /^there should be an edit link$/ do
response.should have_selector :span do |content|
content.should have_selector :a, attribute = {:title => "Edit the feature and it's stories"}
Expand Down
9 changes: 0 additions & 9 deletions features/step_definitions/home_page_steps.rb
@@ -1,12 +1,3 @@
Given /^there is a last project$/ do
@project = mock_model(Project,
:title => 'A project',
:creation_date => Time.now.to_s(:long),
:features => [mock_model(Feature).as_new_record],
:null_object => true).as_new_record
Project.stub(:last).and_return @project
end

Given /^there is no last project$/ do
Project.stub(:last).and_return nil
end
Expand Down
4 changes: 0 additions & 4 deletions features/step_definitions/layout_step.rb
@@ -1,7 +1,3 @@
When /^I view the "([^\"]*)" "([^\"]*)"$/ do |model, action|
visit "/#{model}/#{action}"
end

Then /^the view should not have a sidebar$/ do
response.should_not have_selector :div, attribute = {:id => 'sidebar'}
end
Expand Down
18 changes: 0 additions & 18 deletions features/step_definitions/projects_steps.rb
Expand Up @@ -10,10 +10,6 @@
@project = Project.make(:location => "#{RAILS_ROOT}/spec/fixtures/")
end

Given /^the project does not have a project location$/ do
@project.update_attribute(:location,"")
end

Given /^the project does have a project location$/ do
@project.update_attribute(:location, "#{RAILS_ROOT}/spec/fixtures/")
end
Expand Down Expand Up @@ -86,10 +82,6 @@
click_link 'Import'
end

When /^we fill in the features tags$/ do
fill_in 'feature_tag_list', :with => 'new feature, something cool'
end

When /^we fill in the project location$/ do
fill_in 'project_location', :with => "#{RAILS_ROOT}"
end
Expand Down Expand Up @@ -119,10 +111,6 @@
response.should contain "#{value.capitalize} can't be blank"
end

Then /^the user should be told the project already exists$/ do
response.should contain "Title has already been taken"
end

Then /^I should be able to view its details$/ do
response.should have_selector(:span, :content => @project.description)
end
Expand Down Expand Up @@ -195,12 +183,6 @@
response.should have_selector :form, attribute = {:action=>"/projects",:method=>"post"}
end

Then /^there should not be a 'view features' link$/ do
response.should_not have_selector :a, attribute = {:href=>"/projects/1/features"} do |content|
content.should_not contain "Feature"
end
end

Then /^all projects should have a 'Add features' link$/ do
response.should have_selector :li do |content|
content.should have_selector :a, attribute ={:title => 'New Feature'}
Expand Down
6 changes: 0 additions & 6 deletions features/step_definitions/selenium_steps.rb
Expand Up @@ -9,12 +9,6 @@
click_button 'Save'
end

Given /^the project has one feature$/ do
feature = Feature.first
@project = mock_model(Project, :id => 1, :features => [Feature.first]).as_null_object
@project.stub!(:features).and_return feature
end

When /^the first (.*) is hovered over$/ do |model|
selenium.mouse_over("css=ul##{model.pluralize} >li div.#{model}")
end
Expand Down
4 changes: 0 additions & 4 deletions features/step_definitions/steps_steps.rb
Expand Up @@ -2,10 +2,6 @@
Step.make(:title => step)
end

When /^I choose 'New Step' link$/ do
click_link 'New Step'
end

Then /^the new step form should be displayed$/ do
response.should have_selector :form
end
Expand Down
25 changes: 0 additions & 25 deletions features/step_definitions/stories_steps.rb
@@ -1,39 +1,18 @@
# @TODO Find all scenarios that use this step make change them to use our newer version
Given /^the story has steps$/ do
@story ||= Story.first
end

# TODO Make more flexible and speed up
Given /^we have a stories with examples$/ do
f = FeatureFile.new("#{RAILS_ROOT}/features/plain/tag_cloud.feature").export
@story = f.stories.first
@story.save
end

Given /^it has an associated feature$/ do
@story.features << Feature.make
end

When /^I select first feature new story link$/ do
click_link 'New Story'
end

When /^I select first feature$/ do
click_link 'View'
end

When /^uncheck a feature it is associated to$/ do
uncheck 'story_feature_id_1'
end

When /^check a pre\-existing step$/ do
check "#{Step.first.title}"
end

When /^I fill in the story form"$/ do
When %{we fill in the story scenario with 'this is our stories scenario'}
end

Then /^there should be a list of stories$/ do
response.should have_selector(:div) do |content|
content.should have_selector(:ul) do |list|
Expand All @@ -50,10 +29,6 @@
end
end

Then /^the story information should be saved$/ do
assert !Story.find_by_scenario("this is our stories scenario").scenario.nil?
end

Then /^I should see a list of stories$/ do
response.should have_selector :ul do |list|
list.should have_selector :li do |content|
Expand Down

0 comments on commit 6e41692

Please sign in to comment.