From 60aa8fa77deaf9d4c90c1ede37caeeff13ee283d Mon Sep 17 00:00:00 2001 From: mo khan Date: Fri, 21 Feb 2014 22:27:13 -0700 Subject: define well types table. --- spec/models/license_spec.rb | 14 ++++++++++++++ spec/spec_helper.rb | 3 +++ 2 files changed, 17 insertions(+) (limited to 'spec') diff --git a/spec/models/license_spec.rb b/spec/models/license_spec.rb index a939372..d35c51f 100644 --- a/spec/models/license_spec.rb +++ b/spec/models/license_spec.rb @@ -29,4 +29,18 @@ describe License do results.first.should == newest_license end end + + describe "model" do + it "looks like this" do + company = Company.create(name: 'ABC Resources Ltd.') + user = User.new(company: company) + location = Location.new(latitude: 51.06, longitude: -114.09, township: '1') + license = user.apply_for(WellType::NFW, location) + + license.company.should == user.company + license.well_type.should == WellType::NFW + license.location.should == location + license.applicant.should == user + end + end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 943bc19..09b0309 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -39,4 +39,7 @@ RSpec.configure do |config| # the seed, which is printed after each run. # --seed 1234 config.order = "random" + config.before(:suite) do + require "#{Rails.root}/db/seeds" + end end -- cgit v1.2.3