summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2016-05-21 10:49:52 -0600
committermo khan <mo@mokhan.ca>2016-05-21 10:50:37 -0600
commit9ac4cdaba4e4df09f89ffdecaabf69555d62e0d3 (patch)
tree41b2b343cf6f8347b0f90681b48eccfbfdbf26b9 /spec
parentf7329510e820c2f6f58f5c12cf5ae1d177fbbb27 (diff)
hound happy.
Diffstat (limited to 'spec')
-rw-r--r--spec/jobs/import_gyms_job_spec.rb6
-rw-r--r--spec/models/user_session_spec.rb12
2 files changed, 9 insertions, 9 deletions
diff --git a/spec/jobs/import_gyms_job_spec.rb b/spec/jobs/import_gyms_job_spec.rb
index 69e3969..8900f4d 100644
--- a/spec/jobs/import_gyms_job_spec.rb
+++ b/spec/jobs/import_gyms_job_spec.rb
@@ -4,19 +4,19 @@ describe ImportGymsJob do
subject { ImportGymsJob.new }
let(:location) { build(:portland) }
- it 'imports all the gyms in the city' do
+ it "imports all the gyms in the city" do
allow(Gym).to receive(:import)
subject.perform(location)
expect(Gym).to have_received(:import).with(location.city)
end
- it 'skips the import if no location is present' do
+ it "skips the import if no location is present" do
allow(Gym).to receive(:import)
subject.perform(nil)
expect(Gym).to_not have_received(:import)
end
- it 'skips the import of gyms in the city are already present' do
+ it "skips the import of gyms in the city are already present" do
allow(Gym).to receive(:import)
create(:gym, location: location)
diff --git a/spec/models/user_session_spec.rb b/spec/models/user_session_spec.rb
index 7878354..8cc1c18 100644
--- a/spec/models/user_session_spec.rb
+++ b/spec/models/user_session_spec.rb
@@ -11,12 +11,12 @@ describe UserSession do
end
describe "#access" do
- let(:request) { double(ip: '192.168.1.1', user_agent: 'blah') }
+ let(:request) { double(ip: "192.168.1.1", user_agent: "blah") }
let(:location) { build(:location) }
let(:because) { subject.access(request) }
before :each do
- allow(Location).to receive(:build_from_ip).with('192.168.1.1').and_return(location)
+ allow(Location).to receive(:build_from_ip).with("192.168.1.1").and_return(location)
because
end
@@ -54,16 +54,16 @@ describe UserSession do
end
it "returns nil if the id is not active" do
- expect(UserSession.authenticate('blah')).to be_nil
+ expect(UserSession.authenticate("blah")).to be_nil
end
end
describe "#after_create" do
- it 'schedules a job to import gyms in city' do
+ it "schedules a job to import gyms in city" do
allow(ImportGymsJob).to receive(:perform_later)
- subject.location = create(:portland)
+ subject.location = location = create(:portland)
subject.save!
- expect(ImportGymsJob).to have_received(:perform_later).with(subject.location)
+ expect(ImportGymsJob).to have_received(:perform_later).with(location)
end
end
end