docbrown/spec/system/user/user_edits_profile_spec.rb
Vaidehi Joshi 6d1aada37b
Conditionally hide onboarding task card (#11259)
* Hide onboarding task card on feed if user hasn't completed onboarding

* Fix some typos, use consistent capitalization

* Remove unnecessary saw_onboarding: true from test users

* Use predicate method for saw_onboarding?
2020-11-04 11:04:34 -08:00

29 lines
783 B
Ruby

require "rails_helper"
RSpec.describe "User edits their profile", type: :system do
let(:user) { create(:user) }
before do
sign_in user
visit "/settings/profile"
end
describe "visiting /settings/profile" do
it "renders an error if the username contains spaces and thus is invalid" do
fill_in "user[username]", with: "a b c"
click_button "Save"
expect(page).to have_text("Username is invalid")
end
it "makes the 'Save Button' footer sticky once a field is filled in", js: true do
expect(page).not_to have_css(".sticky")
fill_in "user[username]", with: "sloan"
find_field(id: "user[username]").native.send_keys :tab # this un-focuses the filled-in field
expect(page).to have_css(".sticky")
end
end
end