Sha256: 3a3840b2c4c16ec38b59edba87c8049f1848bf2c6e15ac595e216a57590ee6f0

Contents?: true

Size: 1.15 KB

Versions: 6

Compression:

Stored size: 1.15 KB

Contents

require File.expand_path('../test_helper', __FILE__)
require 'test/spec/rails/request_helpers'
require 'test/spec/rails/response_helpers'
require 'test/spec/rails/controller_helpers'

class ActionControllerClass < ActionController::Base; end

describe ActionControllerClass, "response helpers for a controller test" do
  it "should map #controller to the controller instance" do
    controller.should == @controller
  end
  
  it "should map #status to the response status" do
    expects(:assert_response).with(:success, 'the message')
    status.should.be :success, 'the message'
  end
  
  it "should map #template to the response template" do
    expects(:assert_template).with('show', 'the message')
    template.should.be 'show', 'the message'
  end
  
  it "should map #layout to the response layout" do
    @response.stubs(:layout).returns('layouts/application')
    expects(:assert_equal).with('application', 'application', 'the message')
    layout.should.be 'application', 'the message'
  end
end

describe ActionControllerClass, "request helpers for a controller test" do
  it "should make @request available as an accessor" do
    request.should.be @request
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
Fingertips-on-test-spec-0.2.2 test/controller_helpers_test.rb
Fingertips-on-test-spec-0.2.3 test/controller_helpers_test.rb
on-test-spec-0.3.0 test/controller_helpers_test.rb
on-test-spec-0.2.6 test/controller_helpers_test.rb
on-test-spec-0.2.5 test/controller_helpers_test.rb
on-test-spec-0.2.4 test/controller_helpers_test.rb