Commit f1ae621

mo khan <mo@mokhan.ca>
2016-05-31 03:12:51
stub out more geolocation queries.
1 parent 3035332
spec/features/gyms_spec.rb
@@ -51,25 +51,27 @@ feature "Gyms", type: :feature do
     subject { NewGymPage.new }
 
     it "saves a new gym" do
-      subject.visit_page
-      subject.change(
-        name: "SAIT",
-        address: "1301 16 Ave NW",
-        city: "Calgary",
-        region: "AB",
-        country: "Canada",
-        postal_code: "T2M 0L4",
-      )
+      VCR.use_cassette("geo-location-sait") do
+        subject.visit_page
+        subject.change(
+          name: "SAIT",
+          address: "1301 16 Ave NW",
+          city: "Calgary",
+          region: "AB",
+          country: "Canada",
+          postal_code: "T2M 0L4",
+        )
 
-      expect(Gym.count).to eql(1)
-      gym = Gym.last
-      expect(gym.name).to eql("SAIT")
-      expect(gym.location).to be_present
-      expect(gym.location.address).to eql("1301 16 Ave NW")
-      expect(gym.location.city).to eql("Calgary")
-      expect(gym.location.region).to eql("AB")
-      expect(gym.location.country).to eql("CA")
-      expect(gym.location.postal_code).to eql("T2M 0L4")
+        expect(Gym.count).to eql(1)
+        gym = Gym.last
+        expect(gym.name).to eql("SAIT")
+        expect(gym.location).to be_present
+        expect(gym.location.address).to eql("1301 16 Ave NW")
+        expect(gym.location.city).to eql("Calgary")
+        expect(gym.location.region).to eql("AB")
+        expect(gym.location.country).to eql("CA")
+        expect(gym.location.postal_code).to eql("T2M 0L4")
+      end
     end
   end
 end
spec/features/registrations_spec.rb
@@ -11,7 +11,7 @@ feature "Registrations", type: :feature do
     it "registers a new account" do
       subject.register_with(username: "mo", email: "mo@example.com", password: "password")
 
-      expect(current_path).to eql(dashboard_path)
+      expect(current_path).to eql(edit_profile_path("mo"))
     end
 
     context "when the username is taken" do
spec/vcr/geo-location-70_173_137_232.yml
@@ -6,10 +6,28 @@ http_interactions:
     body:
       encoding: US-ASCII
       string: ''
- response:
+    headers:
+      Accept-Encoding:
+      - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+      Accept:
+      - "*/*"
+      User-Agent:
+      - Ruby
+  response:
     status:
       code: 200
       message: OK
+    headers:
+      Content-Type:
+      - application/json
+      Vary:
+      - Origin
+      X-Database-Date:
+      - Fri, 06 May 2016 11:56:24 GMT
+      Date:
+      - Tue, 31 May 2016 03:09:44 GMT
+      Content-Length:
+      - '246'
     body:
       encoding: UTF-8
       string: '{"ip":"70.173.137.232","country_code":"US","country_name":"United States","region_code":"NV","region_name":"Nevada","city":"Las
@@ -17,5 +35,5 @@ http_interactions:
 
 '
     http_version: 
-  recorded_at: Tue, 31 May 2016 02:42:34 GMT
+  recorded_at: Tue, 31 May 2016 03:09:44 GMT
 recorded_with: VCR 3.0.3