master
1require "rails_helper"
2
3describe "changing my password", js: true do
4 context "when changing my password" do
5 let(:user) { create(:user, password: "password") }
6
7 before { http_login(user) }
8
9 it "displays a confirmation message" do
10 visit my_dashboard_path
11 click_link(I18n.t("my.shared.my_nav.change_password"))
12
13 within(".form-horizontal") do
14 fill_in("user_old_password", with: "password")
15 fill_in("user_password", with: "secret")
16 fill_in("user_password_confirmation", with: "secret")
17 end
18 click_button "Update password"
19 expect(page).to have_content(I18n.translate("my.passwords.updated"))
20 end
21 end
22end