Sha256: 6d8b6ca10ee401b35bafa0e21e466687d1532e423dc34a7a21d87ee7548c6d41

Contents?: true

Size: 543 Bytes

Versions: 3

Compression:

Stored size: 543 Bytes

Contents

require 'spec_helper'

describe ApplicationController, type: :controller do

  before do
    Rails.application.config.time_zone = 'Central Time (US & Canada)'
  end

  it "set the timezone to the configured default if the cookie isn't set" do
    get :welcome
    Time.zone.to_s.should =~ /Central Time/
    response.code.should == "200"
  end

  it "set the timezone based on the cookie" do
    @request.cookies[:timezone] = 'America/Denver'
    get :welcome
    Time.zone.to_s.should =~ /Denver/
    response.code.should == "200"
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
temporal-rails-0.2.4 spec/controllers/application_controller_spec.rb
temporal-rails-0.2.3 spec/controllers/application_controller_spec.rb
temporal-rails-0.2.2 spec/controllers/application_controller_spec.rb