Sha256: edb0bd13876a4a93dbcc2827a3e19e28fa8135dec67f2f2ca2aae4c2c0b937c2
Contents?: true
Size: 1.01 KB
Versions: 31
Compression:
Stored size: 1.01 KB
Contents
require 'rails_helper' describe Effective::AddressesController do routes { EffectiveAddresses::Engine.routes } it 'should render the subregions partial' do get :subregions, :country_code => 'CA' response.status.should be 200 response.should render_template 'effective/addresses/_subregions' end it 'should assign appropriate Canadian subregions' do get :subregions, :country_code => 'CA' assigns(:subregions).first.name.should eq 'Alberta' end it 'should assign appropriate US subregions' do get :subregions, :country_code => 'US' assigns(:subregions).first.name.should eq 'Alaska' end it 'should assign appropriate SG subregions' do get :subregions, :country_code => 'SG' # Singapore assigns(:subregions).first.name.should eq 'Central Singapore' end it 'Should return an error when passed bad country code' do get :subregions, :country_code => 'NOPE' response.status.should be 200 response.body.should eq "<option value=''>None Available</option>" end end
Version data entries
31 entries across 31 versions & 1 rubygems