Skip to content

Commit

Permalink
Fix scenario covering the get_base_dom_id_from_label_tag method.
Browse files Browse the repository at this point in the history
  • Loading branch information
stevehodgkiss committed Mar 23, 2011
1 parent ab7b8b1 commit a3453dc
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions features/select_dates.feature
Expand Up @@ -2,7 +2,9 @@ Feature: Select dates

Background: A simple calendar app
Given I have created a new Rails 3 app "rails-3-app" with cucumber-rails support
And I successfully run `bundle exec rails g scaffold appointment name:string when:datetime`

Scenario: Select dates
Given I successfully run `bundle exec rails g scaffold appointment name:string when:datetime`
And I write to "features/create_appointment.feature" with:
"""
Feature: Create appointments
Expand All @@ -15,15 +17,26 @@ Feature: Select dates
And I should see "2009-02-20 15:10:00 UTC"
"""
When I run `bundle exec rake db:migrate cucumber`

Scenario: Select dates
Then it should pass with:
"""
1 scenario (1 passed)
6 steps (6 passed)
"""

Scenario: Select dates with label pointing to first select
Given I successfully run `bundle exec rails g scaffold appointment name:string when:date`
And I write to "features/create_appointment.feature" with:
"""
Feature: Create appointments
Scenario: Constitution on May 17
Given I am on the new appointment page
And I fill in "Norway's constitution" for "Name"
And I select "2009-02-20 15:10:00 UTC" as the "When" date
And I press "Create Appointment"
Then I should see "Norway's constitution"
And I should see "2009-02-20"
"""
When I run `bundle exec rake db:migrate cucumber`
Given I write to "app/views/appointments/_form.html.erb" with:
"""
<%= form_for(@appointment) do |f| %>
Expand All @@ -32,7 +45,7 @@ Feature: Select dates
<%= f.text_field :name %>
</div>
<div class="field">
<%= f.label :when, :for => "when_1i" %><br />
<%= f.label :when, :for => "appointment_when_1i" %><br />
<%= f.datetime_select :when %>
</div>
<div class="actions">
Expand Down

0 comments on commit a3453dc

Please sign in to comment.