Last active
August 29, 2015 14:00
-
-
Save tarynsauer/a75e1449efe055ebb8be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe ApplicantInteractor do | |
let(:applicant) { Footprints::Repository.applicant.create( :name => "Bob", :applied_on => Date.current, :email => "[email protected]") } | |
describe ".update" do | |
it "updates the applicant" do | |
params = { :name => "John" } | |
ApplicantInteractor.new(applicant, params).update | |
expect(applicant.name).to eq("John") | |
end | |
end | |
describe ".craftsman_changed?" do | |
context "craftsman has changed" do | |
let(:craftsman) { Footprints::Repository.craftsman.create(:name => "A Craftsman", :doppler_id => "007", :email => "[email protected]") } | |
let(:bcraftsman) { Footprints::Repository.craftsman.create(:name => "B Craftsman", :doppler_id => "008", :email => "[email protected]") } | |
it "recognizes that assigned craftsman has changed" do | |
applicant.assigned_craftsman = "B Craftsman" | |
interactor = ApplicantInteractor.new(applicant, :assigned_craftsman => "A Craftsman") | |
expect(interactor.craftsman_changed?).to be_true | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment