Sha256: 63fdeaf3ba3c4b4608e8d5b73459c3af78d62a9708ae1885f32e0f4acc83e9e5

Contents?: true

Size: 1.93 KB

Versions: 15

Compression:

Stored size: 1.93 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'spec_controller_helper'))
require 'spec/interop/test'

describe 'Castronaut Application Controller' do

  describe "requesting / via GET" do

    it "redirects to /login" do
      get_it '/'

      should be_redirection
    end

  end

  describe "requesting /login via GET" do

    it "responds with status 200" do
      get_it '/login', :env => { 'REMOTE_ADDR' => '10.0.0.1' }

      should be_ok
    end

    it "sets the Pragma header to 'no-cache'" do
      get_it '/login', :env => { 'REMOTE_ADDR' => '10.0.0.1' }

      headers['Pragma'].should == 'no-cache'
    end

    it "sets the Cache-Control header to 'no-store'" do
      get_it '/login', :env => { 'REMOTE_ADDR' => '10.0.0.1' }

      headers['Cache-Control'].should == 'no-store'
    end

    it "sets the Expires header to '5 years ago in rfc2822 format'" do
      jan_1st_2008 = Time.parse("01/01/2008 00:00:00")
      jan_1st_2003 = Time.parse("01/01/2003 00:00:00")
      Time.stub!(:now).and_return(jan_1st_2008)
      
      get_it '/login', :env => { 'REMOTE_ADDR' => '10.0.0.1' }

      headers['Expires'].should include("Wed, 01 Jan 2003 00:00:00")
    end

  end

  describe "requesting /login via POST" do

    it 'responds with status 200' do
      post_it '/login', :env => { 'REMOTE_ADDR' => '10.0.0.1' }

      should be_ok
    end

  end

  describe "requesting /logout via GET" do

    it 'responds with status 200' do
      get_it '/logout', :env => { 'REMOTE_ADDR' => '10.0.0.1' }

      should be_ok
    end

  end

  describe "requesting /serviceValidate via GET" do

    it 'responds with status 200' do
      get_it '/serviceValidate', :env => { 'REMOTE_ADDR' => '10.0.0.1' }

      should be_ok
    end

  end
  
  describe "requesting /proxyValidate via GET" do

    it 'responds with status 200' do
      get_it '/proxyValidate', :env => { 'REMOTE_ADDR' => '10.0.0.1' }

      should be_ok
    end

  end

end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
3mix-castronaut-0.5.0.2 spec/app/controllers/application_spec.rb
masover-castronaut-0.4.4.4 spec/app/controllers/application_spec.rb
masover-castronaut-0.4.4.5 spec/app/controllers/application_spec.rb
masover-castronaut-0.5.0.1 spec/app/controllers/application_spec.rb
relevance-castronaut-0.4.1 spec/app/controllers/application_spec.rb
relevance-castronaut-0.4.2 spec/app/controllers/application_spec.rb
relevance-castronaut-0.4.3 spec/app/controllers/application_spec.rb
relevance-castronaut-0.4.4 spec/app/controllers/application_spec.rb
relevance-castronaut-0.4.5 spec/app/controllers/application_spec.rb
relevance-castronaut-0.4.6 spec/app/controllers/application_spec.rb
relevance-castronaut-0.5.0 spec/app/controllers/application_spec.rb
relevance-castronaut-0.5.1 spec/app/controllers/application_spec.rb
relevance-castronaut-0.5.2 spec/app/controllers/application_spec.rb
relevance-castronaut-0.5.3 spec/app/controllers/application_spec.rb
relevance-castronaut-0.5.4 spec/app/controllers/application_spec.rb