Sha256: 8b09b3a7296c2c539c9ac6f00a00e79cfe34219bce5b2b63a69c9501b83dd63a

Contents?: true

Size: 1.25 KB

Versions: 12

Compression:

Stored size: 1.25 KB

Contents

Feature: view spec infers controller path and action

  Scenario: infer controller path
    Given a file named "spec/views/widgets/new.html.erb_spec.rb" with:
      """
      require "spec_helper"

      describe "widgets/new.html.erb" do
        it "infers the controller path" do
          controller.request.path_parameters["controller"].should eq("widgets")
        end
      end
      """
    When I run `rspec spec/views`
    Then the examples should all pass

  Scenario: infer action
    Given a file named "spec/views/widgets/new.html.erb_spec.rb" with:
      """
      require "spec_helper"

      describe "widgets/new.html.erb" do
        it "infers the controller path" do
          controller.request.path_parameters["action"].should eq("new")
        end
      end
      """
    When I run `rspec spec/views`
    Then the examples should all pass

  Scenario: do not infer action in a partial
    Given a file named "spec/views/widgets/_form.html.erb_spec.rb" with:
      """
      require "spec_helper"

      describe "widgets/_form.html.erb" do
        it "includes a link to new" do
          controller.request.path_parameters["action"].should be_nil
        end
      end
      """
    When I run `rspec spec/views`
    Then the examples should all pass

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rspec-rails-2.8.1 features/view_specs/inferred_controller_path.feature
rspec-rails-2.8.0 features/view_specs/inferred_controller_path.feature
rspec-rails-2.8.0.rc2 features/view_specs/inferred_controller_path.feature
rspec-rails-2.8.0.rc1 features/view_specs/inferred_controller_path.feature
rspec-rails-2.7.0 features/view_specs/inferred_controller_path.feature
rspec-rails-2.7.0.rc1 features/view_specs/inferred_controller_path.feature
rspec-rails-2.6.1 features/view_specs/inferred_controller_path.feature
rspec-rails-2.6.1.beta1 features/view_specs/inferred_controller_path.feature
rspec-rails-2.6.0 features/view_specs/inferred_controller_path.feature
rspec-rails-2.6.0.rc6 features/view_specs/inferred_controller_path.feature
rspec-rails-2.6.0.rc4 features/view_specs/inferred_controller_path.feature
rspec-rails-2.6.0.rc2 features/view_specs/inferred_controller_path.feature