Sha256: 8484ebc9b30305331cf64029493d9029c2645a1f0cdaeb442abe5f6b93d74fb9

Contents?: true

Size: 1.35 KB

Versions: 76

Compression:

Stored size: 1.35 KB

Contents

When /^I bootstrap the application for clearance$/ do
  steps %{
    When I remove the file "public/index.html"
    And I successfully run "rails generate cucumber:install"
    And I successfully run "rails generate clearance"
    And I successfully run "rails generate clearance_features"
    And I configure ActionMailer to use "localhost" as a host
    And I add flash messages to the layout
    And I add session links to the layout
    And I configure "clearance/sessions#new" as the root route
    And I disable Capybara Javascript emulation
  }
end

When /^I add flash messages to the layout$/ do
  flashes = %{
    <% flash.each do |key, value| -%>
      <%= value %>
    <% end -%>
  }

  replace_in_file "app/views/layouts/application.html.erb",
                  /(<body>)/,
                  "\\1\n#{flashes}"
end

When /^I add session links to the layout$/ do
  links = %{
    <% if signed_in? -%>
      <%= link_to 'Sign out', sign_out_path, :method => :delete %>
    <% else -%>
      <%= link_to 'Sign in', sign_in_path %>
    <% end -%>
  }

  replace_in_file "app/views/layouts/application.html.erb",
                  /(<body>)/,
                  "\\1\n#{links}"
end

When /^I configure "([^"]*)" as the root route$/ do |action|
  replace_in_file "config/routes.rb",
                  /(routes\.draw do)/,
                  "\\1\nroot :to => '#{action}'"
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
saucy-0.2.28.1 features/step_definitions/clearance_steps.rb
saucy-0.4.6 features/step_definitions/clearance_steps.rb
saucy-0.4.5 features/step_definitions/clearance_steps.rb
saucy-0.4.4 features/step_definitions/clearance_steps.rb
saucy-0.4.3 features/step_definitions/clearance_steps.rb
saucy-0.4.2 features/step_definitions/clearance_steps.rb
saucy-0.4.1 features/step_definitions/clearance_steps.rb
saucy-0.3.4.1 features/step_definitions/clearance_steps.rb
saucy-0.4.0 features/step_definitions/clearance_steps.rb
saucy-0.3.4 features/step_definitions/clearance_steps.rb
saucy-0.3.3 features/step_definitions/clearance_steps.rb
saucy-0.3.2 features/step_definitions/clearance_steps.rb
saucy-0.3.1 features/step_definitions/clearance_steps.rb
saucy-0.3.0 features/step_definitions/clearance_steps.rb
saucy-0.2.45 features/step_definitions/clearance_steps.rb
saucy-0.2.44 features/step_definitions/clearance_steps.rb
saucy-0.2.43 features/step_definitions/clearance_steps.rb
saucy-0.2.42 features/step_definitions/clearance_steps.rb
saucy-0.2.41 features/step_definitions/clearance_steps.rb
saucy-0.2.40 features/step_definitions/clearance_steps.rb