2020-03-23 02:10:31 +00:00
|
|
|
require "rails_helper"
|
2015-08-27 17:47:26 +00:00
|
|
|
|
2015-08-27 17:49:47 +00:00
|
|
|
feature "User Stream Information" do
|
2015-08-27 17:47:26 +00:00
|
|
|
let(:password) { "foobar" }
|
|
|
|
let!(:user) { create :user, raw_password: password }
|
|
|
|
|
2015-08-27 17:49:47 +00:00
|
|
|
feature "stream administration" do
|
|
|
|
scenario "user updates their stream" do
|
2015-08-27 17:47:26 +00:00
|
|
|
visit user_path(user)
|
2015-10-28 02:32:45 +00:00
|
|
|
expect(page.html).to_not include("<dt>Stream</dt>")
|
2020-04-18 05:02:26 +00:00
|
|
|
sign_in_as(user)
|
2015-08-27 17:47:26 +00:00
|
|
|
visit edit_user_path(user)
|
|
|
|
stream_url = "twitch.tv/gold_n"
|
|
|
|
expect(page).to have_content("Stream")
|
|
|
|
fill_in "user_profile_attributes_stream", with: stream_url
|
|
|
|
click_button "Update Profile"
|
|
|
|
expect(page).to have_content(I18n.t(:users_update))
|
|
|
|
visit user_path(user)
|
2015-10-28 02:32:45 +00:00
|
|
|
expect(page.html).to include("<dt>Stream</dt>")
|
2015-08-27 17:47:26 +00:00
|
|
|
expect(page).to have_content(stream_url)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def fill_login_form(user, password)
|
|
|
|
fill_in "login_username", with: user.username
|
|
|
|
fill_in "login_password", with: password
|
|
|
|
end
|
|
|
|
end
|