Sha256: ac2fd6c99cdb6aeb0e0d478c5d9f786571a313cae9f7efcc27c9fe2078f4332b

Contents?: true

Size: 1.24 KB

Versions: 3

Compression:

Stored size: 1.24 KB

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

class DescriptionGenerationSpecController < ActionController::Base
  def render_action
  end

  def redirect_action
    redirect_to :action => :render_action
  end
end

describe "Description generation", :type => :controller do
  controller_name :description_generation_spec

  after(:each) do
    Spec::Matchers.clear_generated_description
  end

  it "should generate description for render_template" do
    get 'render_action'
    response.should render_template("render_action")
    Spec::Matchers.generated_description.should == "should render template \"render_action\""
  end

  it "should generate description for render_template with full path" do
    get 'render_action'
    response.should render_template("description_generation_spec/render_action")
    Spec::Matchers.generated_description.should == "should render template \"description_generation_spec/render_action\""
  end

  it "should generate description for redirect_to" do
    get 'redirect_action'
    response.should redirect_to("http://test.host/description_generation_spec/render_action")
    Spec::Matchers.generated_description.should == "should redirect to \"http://test.host/description_generation_spec/render_action\""
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
picolena-0.1.6 rails_plugins/rspec_on_rails/spec/rails/matchers/description_generation_spec.rb
picolena-0.1.7 rails_plugins/rspec_on_rails/spec/rails/matchers/description_generation_spec.rb
picolena-0.1.8 rails_plugins/rspec_on_rails/spec/rails/matchers/description_generation_spec.rb