Last active
          August 29, 2015 14:00 
        
      - 
      
 - 
        
Save tarynsauer/a75e1449efe055ebb8be to your computer and use it in GitHub Desktop.  
Revisions
- 
        
tarynsauer revised this gist
May 5, 2014 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,22 +1,24 @@ 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  - 
        
tarynsauer created this gist
May 5, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ describe ApplicantInteractor 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]") } 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 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