require "spec_helper" describe User do describe "#apply_for_license" do context "when applying for a license" do let(:company) { Company.create(name: 'ABC Resources Ltd.') } let(:user) { User.create(company: company) } let(:location) { Location.new(latitude: 51.06, longitude: -114.09, township: '1') } it "creates a new license" do license = user.apply_for_license(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 describe "#full_name" do it "returns the full name" do User.new(first_name: "mo", last_name: "khan").full_name.should == "mo khan" end end end