Sha256: 0fbe45495400e06f62fc5541f0d3d4c905f4b86b9df1861e986c39a30259fbc9

Contents?: true

Size: 1.05 KB

Versions: 91

Compression:

Stored size: 1.05 KB

Contents

require 'test_helper'

class RenderTemplateMatcherTest < ActionController::TestCase # :nodoc:

  context "a controller that renders a template" do
    setup do
      @controller = build_response(:action => 'show') { render }
    end

    should "accept rendering that template" do
      assert_accepts render_template(:show), @controller
    end

    should "reject rendering a different template" do
      assert_rejects render_template(:index), @controller
    end

    should "accept rendering that template in the given context" do
      assert_accepts self.class.render_template(:show).in_context(self), @controller
    end

    should "reject rendering a different template in the given context" do
      assert_rejects self.class.render_template(:index).in_context(self), @controller
    end
  end

  context "a  controller that doesn't render a template" do
    setup do
      @controller = build_response { render :nothing => true }
    end

    should "reject rendering a template" do
      assert_rejects render_template(:show), @controller
    end
  end

end

Version data entries

91 entries across 61 versions & 10 rubygems

Version Path
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
dirty_history-0.7.3 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
dirty_history-0.7.2 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
dirty_history-0.7.1 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
dirty_history-0.7.0 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
dirty_history-0.6.7 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
dirty_history-0.6.6 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
dirty_history-0.6.5 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
dirty_history-0.6.4 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
dirty_history-0.6.3 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
challah-0.6.2 vendor/bundle/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
dirty_history-0.6.2 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
dirty_history-0.6.1 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
dirty_history-0.6.0 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
challah-0.6.1 vendor/bundle/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
dirty_history-0.5.4 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb
challah-0.6.0 vendor/bundle/gems/shoulda-2.11.3/test/matchers/controller/render_template_matcher_test.rb