mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-14 13:51:26 +00:00
Merge pull request #50 from cblanc/show_stream
Show stream information on user page
This commit is contained in:
commit
47d6f518af
2 changed files with 31 additions and 0 deletions
|
@ -15,6 +15,9 @@
|
||||||
<%= link_to "Search for Steam Account" %>
|
<%= link_to "Search for Steam Account" %>
|
||||||
</div>
|
</div>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt>Stream</dt>
|
||||||
|
<dd><%= @user.profile.stream.blank? ? "No Stream Provided" : @user.profile.stream %></dd>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<h4>Contact</h4>
|
<h4>Contact</h4>
|
||||||
|
|
28
spec/features/users/stream_spec.rb
Normal file
28
spec/features/users/stream_spec.rb
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
require "spec_helper"
|
||||||
|
|
||||||
|
feature "User Stream Information" do
|
||||||
|
let(:password) { "foobar" }
|
||||||
|
let!(:user) { create :user, raw_password: password }
|
||||||
|
|
||||||
|
feature "stream administration" do
|
||||||
|
scenario "user updates their stream" do
|
||||||
|
visit user_path(user)
|
||||||
|
expect(page).to have_content("No Stream Provided")
|
||||||
|
fill_login_form(user, password)
|
||||||
|
click_button submit(:user, :login)
|
||||||
|
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).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
|
Loading…
Reference in a new issue