diff options
| author | mo khan <mo@mokhan.ca> | 2014-02-21 23:33:01 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-02-21 23:33:01 -0700 |
| commit | daf9b2bb2302e0d8901dd6dee12468f72d5b1ea7 (patch) | |
| tree | 7f75be4fb4ed34ac09b415ce824d0544d4bc8519 | |
| parent | d0aaa1ee5724c4981aba10efeb7e9abde27da13d (diff) | |
add spec for License.township.
| -rw-r--r-- | spec/models/license_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/license_spec.rb b/spec/models/license_spec.rb index a939372..a53fcbe 100644 --- a/spec/models/license_spec.rb +++ b/spec/models/license_spec.rb @@ -29,4 +29,17 @@ describe License do results.first.should == newest_license end end + + describe ".township" do + let(:location) { Location.create(township: "2") } + let!(:license) { License.create(location: location) } + let(:other_location) { Location.create(township: "1") } + let!(:other_license) { License.create(location: other_location) } + + it "returns a license in the township" do + results = License.township("2") + results.count.should == 1 + results.should include(license) + end + end end |
