<commit_before>@broken
Feature: Capybara Javascript Drivers

  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`
    And I write to "features/create_appointment.feature" with:
      """
      @javascript
      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 time
          And I press "Create Appointment"
          Then I should see "Norway's constitution"
          And I should see "2009-02-20 15:10:00 UTC"

      """
  
  Scenario Outline: Use a particular driver
    Given I append to "Gemfile" with:
      """
      <Gemfile extra>

      """
    And I append to "features/support/env.rb" with:
      """
      <env.rb extra>

      """

    When I run `bundle exec rake db:migrate cucumber`
    Then it should pass with:
      """
      1 scenario (1 passed)
      6 steps (6 passed)
      """
      
    Examples:
      | Gemfile extra                    | env.rb extra                                                  |
      | gem "akephalos", :group => :test | require 'akephalos' ; Capybara.javascript_driver = :akephalos |
    <commit_msg>Mixed DB access feature for @javascript drivers<commit_after>Feature: Capybara Javascript Drivers

  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 Outline: Use a particular driver
    Given I write to "features/create_appointment.feature" with:
      """
      @javascript
      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 time
          And I press "Create Appointment"
          Then I should see "Norway's constitution"
          And I should see "2009-02-20 15:10:00 UTC"

      """
    And I append to "Gemfile" with:
      """
      <Gemfile extra>

      """
    And I append to "features/support/env.rb" with:
      """
      <env.rb extra>

      """

    When I run `bundle exec rake db:migrate cucumber`
    Then it should pass with:
      """
      1 scenario (1 passed)
      6 steps (6 passed)
      """

    Examples:
      | Gemfile extra                    | env.rb extra       |
      | gem "capybara", :group => :test  | require 'capybara' |

  Scenario Outline: Mixed DB access
    Given I write to "features/create_appointment.feature" with:
      """
      @javascript
      Feature: Create appointments
        Scenario: Constitution on May 17
          Given a random appointment
          And I am viewing random appointment
          Then I should see "Random appointment"

      """
    And I write to "features/step_definitions/custom_steps.rb" with:
      """
      Given /^a random appointment$/ do
        @appointment = Appointment.create :name => '<NAME>', :when => DateTime.now
      end

      Given /^I am viewing random appointment$/ do
        visit appointment_path(@appointment)
      end
      """
    And I append to "Gemfile" with:
      """
      <Gemfile extra>

      """
    And I append to "features/support/env.rb" with:
      """
      <env.rb extra>

      """

    When I run `bundle exec rake db:migrate cucumber`
    Then it should pass with:
      """
      1 scenario (1 passed)
      3 steps (3 passed)
      """

    Examples:
      | Gemfile extra                    | env.rb extra       |
      | gem "capybara", :group => :test  | require 'capybara' |

{'fraction_non_alphanumeric': 0.08622448979591837, 'fraction_numerical': 0.01989795918367347, 'mean_word_length': 2.0489891135303266, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6261463', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1069, 'n_words': 419}