Last change
on this file since 420 was 420, checked in by KOBAYASHI, Shinji, 14 years ago |
implementing terminology related tables
|
File size:
830 bytes
|
Rev | Line | |
---|
[420] | 1 | require 'spec_helper'
|
---|
| 2 |
|
---|
| 3 | describe Territory do
|
---|
| 4 | fixtures :territories
|
---|
| 5 |
|
---|
| 6 | before(:each) do
|
---|
| 7 | @valid_attributes = {
|
---|
| 8 | :text => "Japan",
|
---|
| 9 | :three_letter => "JPN",
|
---|
| 10 | :numeric_code => "392",
|
---|
| 11 | :two_letter => "JP"
|
---|
| 12 | }
|
---|
| 13 | end
|
---|
| 14 |
|
---|
| 15 | it "should create a new instance given valid attributes" do
|
---|
| 16 | Territory.create!(@valid_attributes)
|
---|
| 17 | end
|
---|
| 18 |
|
---|
| 19 | it 'should return true if three letter code is on the table' do
|
---|
| 20 | Territory.should have_three_letter 'AFG'
|
---|
| 21 | end
|
---|
| 22 |
|
---|
| 23 | it 'should return false if three leter code is out of the table' do
|
---|
| 24 | Territory.should_not have_three_letter 'ZZZ'
|
---|
| 25 | end
|
---|
| 26 |
|
---|
| 27 | it 'should return true if two letter code is on the table' do
|
---|
| 28 | Territory.should have_two_letter 'AF'
|
---|
| 29 | end
|
---|
| 30 |
|
---|
| 31 | it 'should return false if two letter code is out of the table' do
|
---|
| 32 | Territory.should_not have_two_letter 'ZZ'
|
---|
| 33 | end
|
---|
| 34 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.