Commit 98dfde94

mo khan <mo@mokhan.ca>
2013-07-20 13:39:11
add specs for registering a new user
1 parent 77d8a3a
Changed files (2)
spec/features/logins_spec.rb
@@ -7,21 +7,4 @@ describe "Logins" do
       page.should have_content("Got an account? Login!")
     end
   end
-
-  describe "Signup for a new user account" do
-    it "should make a new user present a confirmation" do
-      visit "/login"
-
-      within(".form-horizontal") do
-        fill_in('user_name', :with => 'John Smith')
-        fill_in('user_city', :with => 'Calgary, Alberta, Canada')
-        fill_in('user_email',:with => 'test@example.com')
-        fill_in('user_password', :with => 'password')
-        fill_in('user_password_confirmation', :with => 'password')
-        click_button "submit-registration"
-      end
-
-      page.should have_content "You have signed up successfully"
-    end
-  end
 end
spec/features/registration_spec.rb
@@ -0,0 +1,25 @@
+require "spec_helper"
+
+describe "Registration", :js => true do
+  context "when an email is not registered" do
+    before :each do
+      visit "/login"
+      within(".form-horizontal") do
+        fill_in('user_name', :with => 'John Smith')
+        fill_in('user_city', :with => 'Calgary, Alberta, Canada')
+        fill_in('user_email',:with => Faker::Internet.email)
+        fill_in('user_password', :with => 'password')
+        fill_in('user_password_confirmation', :with => 'password')
+        click_button "submit-registration"
+      end
+    end
+
+    it "should let you register with that email address" do
+      page.should have_content "You have signed up successfully"
+    end
+
+    it "should take you to the settings page" do
+      page.should have_content("Settings")
+    end
+  end
+end