summaryrefslogtreecommitdiff
path: root/spec/models/user_spec.rb
blob: 02e52be5add893a0d77de4607644fd28ef479db7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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