require 'spec_helper' describe Territory do fixtures :territories before(:each) do @valid_attributes = { :text => "Japan", :three_letter => "JPN", :numeric_code => "392", :two_letter => "JP" } end it "should create a new instance given valid attributes" do Territory.create!(@valid_attributes) end it 'should return true if three letter code is on the table' do Territory.should have_three_letter 'AFG' end it 'should return false if three leter code is out of the table' do Territory.should_not have_three_letter 'ZZZ' end it 'should return true if two letter code is on the table' do Territory.should have_two_letter 'AF' end it 'should return false if two letter code is out of the table' do Territory.should_not have_two_letter 'ZZ' end end