remove the last rspec story and migrate it to cucumber. Also remove equivalent selenium script

This commit is contained in:
Reinier Balt 2010-02-09 10:27:59 +01:00
parent 8d10deac30
commit d945d974a7
12 changed files with 52 additions and 202 deletions

View file

@ -0,0 +1,21 @@
Feature: Manage contexts
In order to manage my contexts
As a Tracks user
I want to view, edit, add, or remove contexts
Background:
Given the following user record
| login | password | is_admin |
| testuser | secret | false |
And I have logged in as "testuser" with password "secret"
@selenium
Scenario: In place edit of context name
Given I have a context called "Errands"
When I visits the context page for "Errands"
And I edit the context name in place to be "OutAndAbout"
Then I should see the context name is "OutAndAbout"
When I go to the contexts page
Then he should see that a context named "Errands" is not present
And he should see that a context named "OutAndAbout" is present

View file

@ -0,0 +1,27 @@
Given /^I have a context called "([^\"]*)"$/ do |context_name|
@current_user.contexts.create!(:name => context_name)
end
When /^I visits the context page for "([^\"]*)"$/ do |context_name|
context = @current_user.contexts.find_by_name(context_name)
context.should_not be_nil
visit "/contexts/#{context.id}"
end
When /^I edit the context name in place to be "([^\"]*)"$/ do |new_context_name|
selenium.click "context_name"
fill_in "value", :with => "OutAndAbout"
click_button "OK"
end
Then /^I should see the context name is "([^\"]*)"$/ do |context_name|
Then "I should see \"#{context_name}\""
end
Then /^he should see that a context named "([^\"]*)" is present$/ do |context_name|
Then "I should see \"#{context_name}\""
end
Then /^he should see that a context named "([^\"]*)" is not present$/ do |context_name|
Then "I should not see \"#{context_name}\""
end

View file

@ -14,6 +14,8 @@ module NavigationHelpers
login_path
when /the notes page/
notes_path
when /the contexts page/
contexts_path
# Add more page name => path mappings here

View file

@ -1,6 +1,7 @@
Webrat.configure do |config|
config.mode = :selenium
config.application_environment = :selenium
config.selenium_browser_startup_timeout = 30
end
Cucumber::Rails::World.use_transactional_fixtures = false