Created
October 30, 2012 21:20
-
-
Save tomdepplito/3983150 to your computer and use it in GitHub Desktop.
utils_spec.rb
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
context '#ban_devices' do | |
before :each do | |
@device1 = FactoryGirl.create(:device) | |
device2 = FactoryGirl.create(:device) | |
click1 = FactoryGirl.create(:click, :udid => @device1.id) | |
click2 = FactoryGirl.create(:click, :udid => device2.id) | |
notes = {'date' => '10/24/12', 'reason' => 'fraud'} | |
@click_hash = {click1.id => notes, click2.id => notes} | |
@num_banned = Utils.ban_devices(@click_hash) | |
end | |
it "should find and ban a device when passed a Click ID" do | |
Device.find(@device1.id).banned.should == true | |
end | |
it "should find and ban multiple devices when passed a hash of Click IDs" do | |
@num_banned.should eq @click_hash.length | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment