Sha256: 761d2792620a9a3eac2c0667eadea42e0b5f4bfe330fe33dc4a4cd4ee31f4f01

Contents?: true

Size: 1.3 KB

Versions: 12

Compression:

Stored size: 1.3 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:
      """ruby
      require "spec_helper"

      describe "widgets/new" do
        it "infers the controller path" do
          expect(controller.request.path_parameters[:controller]).to eq("widgets")
          expect(controller.controller_path).to 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:
      """ruby
      require "spec_helper"

      describe "widgets/new" do
        it "infers the controller path" do
          expect(controller.request.path_parameters[:action]).to 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:
      """ruby
      require "spec_helper"

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

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-rails-2.13.0/features/view_specs/inferred_controller_path.feature
rspec-rails-3.0.0.beta2 features/view_specs/inferred_controller_path.feature
rspec-rails-2.99.0.beta2 features/view_specs/inferred_controller_path.feature
rspec-rails-2.14.1 features/view_specs/inferred_controller_path.feature
rspec-rails-3.0.0.beta1 features/view_specs/inferred_controller_path.feature
rspec-rails-2.99.0.beta1 features/view_specs/inferred_controller_path.feature
rspec-rails-2.14.0 features/view_specs/inferred_controller_path.feature
rspec-rails-2.13.1 features/view_specs/inferred_controller_path.feature
rspec-rails-2.13.0 features/view_specs/inferred_controller_path.feature
rspec-rails-2.12.2 features/view_specs/inferred_controller_path.feature
rspec-rails-2.12.1 features/view_specs/inferred_controller_path.feature
rspec-rails-2.12.0 features/view_specs/inferred_controller_path.feature