summaryrefslogtreecommitdiff
path: root/spec/models/user_spec.rb
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-02-21 22:57:51 -0700
committermo khan <mo@mokhan.ca>2014-02-21 22:57:51 -0700
commit33cb4e479decb1f7e15048b8c81924fe7498aec1 (patch)
tree0ce2c2e506e95fa2d1146e9b5505f0d718529bae /spec/models/user_spec.rb
parentbf5c3435155c0ee9c2172bea6b6b3c5dec2c2463 (diff)
create users table and save applicant with the license.
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r--spec/models/user_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
new file mode 100644
index 0000000..02e52be
--- /dev/null
+++ b/spec/models/user_spec.rb
@@ -0,0 +1,19 @@
+require "spec_helper"
+
+describe User do
+ describe "#apply_for" do
+ context "when applying for a license" do
+ it "creates a new license" do
+ company = Company.create(name: 'ABC Resources Ltd.')
+ user = User.create(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
+end