Sha256: a7d6a75777e34fbd7176e1a13772ba2fb216dce224735880b57d27cc2d6030bd

Contents?: true

Size: 1.22 KB

Versions: 18

Compression:

Stored size: 1.22 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" 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" 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" 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

18 entries across 13 versions & 4 rubygems

Version Path
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/view_specs/inferred_controller_path.feature
rspec-rails-2.11.4 features/view_specs/inferred_controller_path.feature
gem_repackager-0.1.0 support/gems/rspec-rails-2.11.0/features/view_specs/inferred_controller_path.feature
rspec-rails-2.11.0 features/view_specs/inferred_controller_path.feature
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/view_specs/inferred_controller_path.feature
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/view_specs/inferred_controller_path.feature
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/view_specs/inferred_controller_path.feature
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/view_specs/inferred_controller_path.feature
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/view_specs/inferred_controller_path.feature
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/view_specs/inferred_controller_path.feature
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/view_specs/inferred_controller_path.feature
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/view_specs/inferred_controller_path.feature
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/view_specs/inferred_controller_path.feature
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/view_specs/inferred_controller_path.feature
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/view_specs/inferred_controller_path.feature
rails-uploader-0.0.1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/view_specs/inferred_controller_path.feature
rspec-rails-2.10.1 features/view_specs/inferred_controller_path.feature
rspec-rails-2.10.0 features/view_specs/inferred_controller_path.feature