From b4725a10f645ae35d688a0763952c2225759ba9a Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Mon, 25 Jul 2016 22:37:02 +0300 Subject: [PATCH] Cleanup --- .rubocop.yml | 4 ++++ app/views/my/_landing_page.html.erb | 2 +- app/views/projects/_landing_page.html.erb | 2 +- app/views/users/_landing_page.html.erb | 2 +- test/functional/projects_controller_test.rb | 4 ++-- test/functional/welcome_controller_test.rb | 4 ++-- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 1b99e96..7951cdd 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -18,3 +18,7 @@ Style/TrailingBlankLines: Style/HashSyntax: Enabled: true +# String interpolations should have spaces. e.g. "#{ good }", "#{bad}" +Style/SpaceInsideStringInterpolation: + EnforcedStyle: space + diff --git a/app/views/my/_landing_page.html.erb b/app/views/my/_landing_page.html.erb index 926632e..4add980 100644 --- a/app/views/my/_landing_page.html.erb +++ b/app/views/my/_landing_page.html.erb @@ -1 +1 @@ -

<%= form.text_field :landing_page, :style => 'width: 90%', :placeholder => "#{request.scheme}://#{request.host_with_port}/projects/demo/wiki/Wiki" %>

+

<%= form.text_field :landing_page, :style => 'width: 90%', :placeholder => "#{ request.scheme }://#{ request.host_with_port }/projects/demo/wiki/Wiki" %>

diff --git a/app/views/projects/_landing_page.html.erb b/app/views/projects/_landing_page.html.erb index 627fc1a..7430247 100644 --- a/app/views/projects/_landing_page.html.erb +++ b/app/views/projects/_landing_page.html.erb @@ -1 +1 @@ -

<%= form.text_field :landing_page, :size => 60, :placeholder => "#{request.scheme}://#{request.host_with_port}/projects/demo/wiki/Wiki" %>

+

<%= form.text_field :landing_page, :size => 60, :placeholder => "#{ request.scheme }://#{ request.host_with_port }/projects/demo/wiki/Wiki" %>

diff --git a/app/views/users/_landing_page.html.erb b/app/views/users/_landing_page.html.erb index d8018ff..7cc1f92 100644 --- a/app/views/users/_landing_page.html.erb +++ b/app/views/users/_landing_page.html.erb @@ -1 +1 @@ -

<%= form.text_field :landing_page, :style => 'width: 90%', :placeholder => "#{request.scheme}://#{request.host_with_port}/projects/demo/wiki/Wiki" %>

+

<%= form.text_field :landing_page, :style => 'width: 90%', :placeholder => "#{ request.scheme }://#{ request.host_with_port }/projects/demo/wiki/Wiki" %>

diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index f5c597c..35fcf65 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -17,8 +17,8 @@ class ProjectsControllerTest < ActionController::TestCase def test_redirect_to_landing_page @project = Project.generate!(identifier: 'demo', - landing_page: "http://#{@request.host}/projects/demo/news") + landing_page: "http://#{ @request.host }/projects/demo/news") get :show, id: @project.identifier - assert_redirected_to "http://#{@request.host}/projects/#{@project.identifier}/news" + assert_redirected_to "http://#{ @request.host }/projects/#{ @project.identifier }/news" end end diff --git a/test/functional/welcome_controller_test.rb b/test/functional/welcome_controller_test.rb index 35d98dd..6677750 100644 --- a/test/functional/welcome_controller_test.rb +++ b/test/functional/welcome_controller_test.rb @@ -15,9 +15,9 @@ class WelcomeControllerTest < ActionController::TestCase end def test_redirect_to_landing_page - @user = User.generate!(landing_page: "http://#{@request.host}/projects") + @user = User.generate!(landing_page: "http://#{ @request.host }/projects") @request.session[:user_id] = @user.id get :index - assert_redirected_to "http://#{@request.host}/projects" + assert_redirected_to "http://#{ @request.host }/projects" end end