Skip to content

Commit 9306eb6

Browse files
committed
Remove data-turbolinks-action from user name tag
1 parent 378a62f commit 9306eb6

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

app/assets/stylesheets/application.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ textarea,
4444
body {
4545
background: #e9eaed;
4646
color: $black;
47-
font-family: Helvetica,Arial,"PingFang SC","Hiragino Sans GB","Source Han Sans CN",Roboto,"Heiti SC","Microsoft Yahei",sans-serif;
47+
font-family: Helvetica, Arial,"PingFang SC","Hiragino Sans GB","Source Han Sans CN",Roboto,"Heiti SC","Microsoft Yahei",sans-serif;
4848
padding-top: 65px;
4949
}
5050

app/helpers/users_helper.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def user_name_tag(user, options = {})
1919
name ||= login
2020
options[:class] ||= "#{user_type}-name"
2121
options['data-name'.freeze] = name
22-
options['data-turbolinks-action'] = 'replace'
2322

2423
link_to(login, main_app.user_path(user), options)
2524
end
@@ -52,7 +51,6 @@ def user_avatar_tag(user, version = :md, opts = {})
5251
end
5352

5453
options = {}
55-
options['data-turbolinks-action'] = 'replace'
5654

5755
if opts[:link] != false
5856
link_to(raw(img), user_path(user), options)

spec/helpers/users_helper_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
describe 'user_name_tag' do
1515
it 'should result right html in normal' do
1616
user = build(:user)
17-
expect(helper.user_name_tag(user)).to eq(link_to(user.login, user_path(user.login), class: 'user-name', 'data-name' => user.name, 'data-turbolinks-action' => 'replace'))
17+
expect(helper.user_name_tag(user)).to eq(link_to(user.login, user_path(user.login), class: 'user-name', 'data-name' => user.name))
1818
end
1919

2020
it 'should result right html with string param and downcase url' do
2121
login = 'Monster'
22-
expect(helper.user_name_tag(login)).to eq(link_to(login, user_path(login), class: 'user-name', 'data-name' => login, 'data-turbolinks-action' => 'replace'))
22+
expect(helper.user_name_tag(login)).to eq(link_to(login, user_path(login), class: 'user-name', 'data-name' => login))
2323
end
2424

2525
it 'should out name with Team' do
2626
user = build(:team)
27-
expect(helper.user_name_tag(user)).to eq(link_to(user.name, user_path(user.login), class: 'team-name', 'data-name' => user.name, 'data-turbolinks-action' => 'replace'))
27+
expect(helper.user_name_tag(user)).to eq(link_to(user.name, user_path(user.login), class: 'team-name', 'data-name' => user.name))
2828
end
2929

3030
it 'should result empty with nil param' do
@@ -40,14 +40,14 @@
4040
it 'should work if user exists' do
4141
user = create(:user)
4242
img = image_tag(user.letter_avatar_url(96), class: 'media-object avatar-48')
43-
expect(user_avatar_tag(user)).to eq link_to(raw(img), user_path(user), 'data-turbolinks-action' => 'replace')
43+
expect(user_avatar_tag(user)).to eq link_to(raw(img), user_path(user))
4444
end
4545

4646
it 'should work if avatar exist' do
4747
user = create(:avatar_user)
4848
image_url = user.avatar.url(:md)
4949
img = image_tag(image_url, class: 'media-object avatar-48')
50-
expect(user_avatar_tag(user)).to eq link_to(raw(img), user_path(user), 'data-turbolinks-action' => 'replace')
50+
expect(user_avatar_tag(user)).to eq link_to(raw(img), user_path(user))
5151
end
5252

5353
it 'should work with different size' do
@@ -58,7 +58,7 @@
5858
user = create(:avatar_user)
5959
image_url = user.avatar.url(:md) + "?t=#{user.updated_at.to_i}"
6060
img = image_tag(image_url, class: 'media-object avatar-48')
61-
expect(user_avatar_tag(user, :md, timestamp: true)).to eq link_to(raw(img), user_path(user), 'data-turbolinks-action' => 'replace')
61+
expect(user_avatar_tag(user, :md, timestamp: true)).to eq link_to(raw(img), user_path(user))
6262
end
6363

6464
it 'should work if link is false' do

0 commit comments

Comments
 (0)