diff --git a/app/models/checkout.rb b/app/models/checkout.rb index ad4233f0..b970e729 100644 --- a/app/models/checkout.rb +++ b/app/models/checkout.rb @@ -24,15 +24,6 @@ class Checkout < ActiveRecord::Base include Messenger - # For lookups - def card_number=( card_number ) - @card_number = card_number - end - - def card_number - @card_number - end - validates_presence_of :tool, :organization validates_associated :tool, :organization, :participant diff --git a/app/models/participant.rb b/app/models/participant.rb index a67b6655..4a25a328 100644 --- a/app/models/participant.rb +++ b/app/models/participant.rb @@ -70,14 +70,6 @@ def booth_chair_organizations def is_scc? !organizations.find_by(name: "Spring Carnival Committee").blank? end - - def card_number=( card_number ) - @card_number = card_number - end - - def card_number - @card_number - end def name cached_name diff --git a/app/models/shift_participant.rb b/app/models/shift_participant.rb index 57241a6c..6d895a15 100644 --- a/app/models/shift_participant.rb +++ b/app/models/shift_participant.rb @@ -30,13 +30,4 @@ class ShiftParticipant < ActiveRecord::Base scope :checked_in_late, lambda{ joins(:shift).where('starts_at < ? AND clocked_in_at > starts_at', Time.zone.now)} - # For lookups - def card_number=( card_number ) - @card_number = card_number - end - - def card_number - @card_number - end - end \ No newline at end of file diff --git a/test/unit/participant_test.rb b/test/unit/participant_test.rb index 580bfb51..dd884668 100644 --- a/test/unit/participant_test.rb +++ b/test/unit/participant_test.rb @@ -41,7 +41,7 @@ class ParticipantTest < ActiveSupport::TestCase context "With a proper context, " do setup do @participant = FactoryGirl.create(:participant, :phone_number => 1234567890, :andrewid => "saclark", :cached_name => "Stephen Clark", :waiver_start => DateTime.now - 10.minutes) - @organization_category = FactoryGirl.create(:organization_category) + @organization_category = FactoryGirl.create(:organization_category, :is_building => true) @organization = FactoryGirl.create(:organization, :name => "Spring Carnival Committee", :organization_category => @organization_category) @temp_participant = FactoryGirl.create(:participant) @membership = FactoryGirl.create(:membership, :is_booth_chair => true, :participant => @participant, :organization => @organization) @@ -111,6 +111,12 @@ class ParticipantTest < ActiveSupport::TestCase assert_equal true, @temp_participant.is_waiver_cheater? end + + should "show that booth_chair_organizations method works correctly" do + assert_equal [@organization], @participant.booth_chair_organizations + + assert_equal [], @temp_participant.booth_chair_organizations + end should "show that is_booth_chair method works correctly" do assert_equal true, @participant.is_booth_chair? diff --git a/test/unit/tool_test.rb b/test/unit/tool_test.rb index 671a5112..08e49a4b 100644 --- a/test/unit/tool_test.rb +++ b/test/unit/tool_test.rb @@ -44,7 +44,7 @@ class ToolTest < ActiveSupport::TestCase @shannon_participant = FactoryGirl.create(:participant) # Create 6 tools - @hammer = FactoryGirl.create(:tool, :barcode => 12811) + @hammer = FactoryGirl.create(:tool, :barcode => 12811, :description => "") @saw_type = FactoryGirl.create(:tool_type, name: 'Saw') @saw = FactoryGirl.create(:tool, :barcode => 12390, :description => "SAW", tool_type: @saw_type) @@ -151,6 +151,7 @@ class ToolTest < ActiveSupport::TestCase should "show that that the method formatted name works" do assert_equal '12810: Radio - RADIO', @radio.formatted_name assert_equal '12012: Ladder - LADDER', @ladder.formatted_name + assert_equal '12811: Hammer', @hammer.formatted_name end end