Sha256: 0c1ce4e5da396e87896f61f03de88841b164c445d2c66eb500c69c95e40e99ce

Contents?: true

Size: 1.38 KB

Versions: 7

Compression:

Stored size: 1.38 KB

Contents

require 'spec_helper'

describe Frameworks::EnvHelper do

  before do
    ENV['BROWSER'] = 'test' #mandatory data to prevent validation exception
  end

  describe "set base url correctly" do
    include Frameworks::EnvHelper

    it "should be able to set a local url" do
      ENV['ENVIRONMENT'] = 'sandbox'
      generate_base_urls
      @base_url.should == 'http://pal.sandbox.dev.bbc.co.uk'
      @static_base_url.should == 'http://static.sandbox.dev.bbc.co.uk'
    end

    it "should be able to set a base url" do
      ENV['ENVIRONMENT'] = 'foo'
      generate_base_urls
      @base_url.should == 'http://www.foo.bbc.co.uk'
      @static_base_url.should == 'http://static.foo.bbc.co.uk'
      @open_base_url.should == 'http://open.foo.bbc.co.uk'
    end

    it "should be able to set a 'classic' live url" do
      ENV['ENVIRONMENT'] = 'live'
      ENV['WWW_LIVE'] = 'false' 
      generate_base_urls
      @base_url.should == 'http://www.bbc.co.uk'
      @static_base_url.should == 'http://static.bbc.co.uk'
      @open_base_url.should == 'http://open.bbc.co.uk'
    end

    it "should be able to set scheme to ssl" do
      ENV['SCHEME'] = 'https'
      ENV['ENVIRONMENT'] = 'foo'
      generate_base_urls
      @base_url.should == 'https://www.foo.bbc.co.uk'
      @static_base_url.should == 'https://static.foo.bbc.co.uk'
      @open_base_url.should == 'https://open.foo.bbc.co.uk'
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
frameworks-capybara-0.1.8 spec/frameworks_cucumber_spec.rb
frameworks-capybara-0.1.6 spec/frameworks_cucumber_spec.rb
frameworks-capybara-0.1.5 spec/frameworks_cucumber_spec.rb
frameworks-capybara-0.1.4 spec/frameworks_cucumber_spec.rb
frameworks-capybara-0.1.3 spec/frameworks_cucumber_spec.rb
frameworks-capybara-0.1.2 spec/frameworks_cucumber_spec.rb
frameworks-capybara-0.1.1 spec/frameworks_cucumber_spec.rb