ensl.org/spec/features/users/stream_spec.rb

29 lines
899 B
Ruby
Raw Normal View History

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)
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)
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