Module Shoulda::ActionView::Macros
In: lib/shoulda/action_view/macros.rb

Macro test helpers for your view

By using the macro helpers you can quickly and easily create concise and easy to read test suites.

This code segment:

  context "on GET to :new" do
    setup do
      get :new
    end

    should_render_page_with_metadata :title => /index/

    should "do something else really cool" do
      assert_select '#really_cool'
    end
  end

Would produce 3 tests for the show action

Methods

Public Instance methods

Macro that creates a test asserting that the rendered view contains a <form> element.

Deprecated.

Deprecated.

Macro that creates a test asserting that the rendered view contains the selected metatags. Values can be string or Regexps. Example:

  should_render_page_with_metadata :description => "Description of this page", :keywords => /post/

You can also use this method to test the rendered views title.

Example:

  should_render_page_with_metadata :title => /index/

[Validate]