Commit c550b51d

mo khan <mo@mokhan.ca>
2013-07-27 02:29:48
add feature spec to ensure password reset functionality is working
1 parent 37a3e5b
Changed files (1)
spec/features/forgot_password_spec.rb
@@ -0,0 +1,20 @@
+require "spec_helper"
+
+describe "password retrieval", :js => true do
+  context "when a user attempts to retrieve their password" do
+    let(:user) { create(:user) }
+
+    before :each do
+      visit user_session_path
+      click_link "Forgot your password?"
+      within "#new_user" do
+        fill_in "user_email", :with => user.email
+      end
+      click_button "Send me reset password instructions"
+    end
+
+    it "should send them an email with instructions" do
+      page.should have_content(I18n.t('devise.passwords.send_instructions'))
+    end
+  end
+end