Commit 8c029c0
Changed files (3)
config
spec
controllers
models
config/i18n-tasks.yml
@@ -66,9 +66,8 @@ search:
# api_key: "AbC-dEf5"
## Consider these keys not missing
-# ignore_missing:
-# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
-# - '{devise,simple_form}.*'
+ignore_missing:
+ - views.pagination.*
## Consider these keys used
# ignore_unused:
spec/controllers/gyms_controller_spec.rb
@@ -28,11 +28,11 @@ describe GymsController do
end
it 'returns matches from yelp' do
- yelp_gym = double
- allow(Gym).to receive(:search_yelp).and_return([yelp_gym])
+ gym = build(:gym)
+ allow(Search).to receive(:yelp).and_return(Kaminari.paginate_array([gym]))
get :index, q: 'sait', source: 'yelp'
- expect(assigns(:gyms)).to match_array([yelp_gym])
+ expect(assigns(:gyms)).to match_array([gym])
expect(response).to be_ok
end
end
spec/models/location_spec.rb
@@ -39,9 +39,9 @@ describe Location do
expect(result.city).to eql("Las Vegas")
expect(result.region).to eql("NV")
expect(result.country).to eql("US")
- expect(result.postal_code).to eql("89101")
- expect(result.latitude).to be_within(0.1).of(36.1)
- expect(result.longitude).to be_within(0.1).of(-115.1)
+ expect(result.postal_code).to start_with("8910")
+ expect(result.latitude).to be_within(0.2).of(36.1)
+ expect(result.longitude).to be_within(0.2).of(-115.1)
end
it 'returns a location from the ip address' do