diff --git a/features/select_dates.feature b/features/select_dates.feature index f5ef0300..5dc375c8 100644 --- a/features/select_dates.feature +++ b/features/select_dates.feature @@ -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 @@ -15,8 +17,6 @@ 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) @@ -24,6 +24,19 @@ Feature: Select dates """ 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| %> @@ -32,7 +45,7 @@ Feature: Select dates <%= f.text_field :name %>
- <%= f.label :when, :for => "when_1i" %>
+ <%= f.label :when, :for => "appointment_when_1i" %>
<%= f.datetime_select :when %>