From 9ae92b8caa6c11d8860f86b7d6378062215d1b72 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Wed, 12 Jul 2017 02:29:33 +0800 Subject: Add cop to make sure we don't use ivar in a module --- features/support/env.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'features/support') diff --git a/features/support/env.rb b/features/support/env.rb index 608d988755c..d99078d4fa3 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -42,11 +42,11 @@ module StdoutReporterWithScenarioLocation # Override the standard reporter to show filename and line number next to each # scenario for easy, focused re-runs def before_scenario_run(scenario, step_definitions = nil) - @max_step_name_length = scenario.steps.map(&:name).map(&:length).max if scenario.steps.any? + max_step_name_length = scenario.steps.map(&:name).map(&:length).max if scenario.steps.any? name = scenario.name # This number has no significance, it's just to line things up - max_length = @max_step_name_length + 19 + max_length = max_step_name_length + 19 out.puts "\n #{'Scenario:'.green} #{name.light_green.ljust(max_length)}" \ " # #{scenario.feature.filename}:#{scenario.line}" end -- cgit v1.2.1 From 45568bed36095db0df94cf89a8a04458f56f33dc Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 21 Nov 2017 23:15:24 +0800 Subject: Updates based on feedback --- features/support/env.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'features/support') diff --git a/features/support/env.rb b/features/support/env.rb index b93ddecdced..a1413522f3a 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -42,11 +42,11 @@ module StdoutReporterWithScenarioLocation # Override the standard reporter to show filename and line number next to each # scenario for easy, focused re-runs def before_scenario_run(scenario, step_definitions = nil) - max_step_name_length = scenario.steps.map(&:name).map(&:length).max if scenario.steps.any? + @max_step_name_length = scenario.steps.map(&:name).map(&:length).max if scenario.steps.any? # rubocop:disable Cop/ModuleWithInstanceVariables name = scenario.name # This number has no significance, it's just to line things up - max_length = max_step_name_length + 19 + max_length = @max_step_name_length + 19 # rubocop:disable Cop/ModuleWithInstanceVariables out.puts "\n #{'Scenario:'.green} #{name.light_green.ljust(max_length)}" \ " # #{scenario.feature.filename}:#{scenario.line}" end -- cgit v1.2.1 From 07d3d44775f6cc5b7a1b768cb4e5b7900d543815 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Wed, 22 Nov 2017 15:50:36 +0800 Subject: Move ModuleWithInstanceVariables to Gitlab namespace And use .rubocop.yml to exclude paths we don't care, rather than using the cop itself to exclude. --- features/support/env.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'features/support') diff --git a/features/support/env.rb b/features/support/env.rb index a1413522f3a..b8df707a8ee 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -42,11 +42,11 @@ module StdoutReporterWithScenarioLocation # Override the standard reporter to show filename and line number next to each # scenario for easy, focused re-runs def before_scenario_run(scenario, step_definitions = nil) - @max_step_name_length = scenario.steps.map(&:name).map(&:length).max if scenario.steps.any? # rubocop:disable Cop/ModuleWithInstanceVariables + @max_step_name_length = scenario.steps.map(&:name).map(&:length).max if scenario.steps.any? # rubocop:disable Gitlab/ModuleWithInstanceVariables name = scenario.name # This number has no significance, it's just to line things up - max_length = @max_step_name_length + 19 # rubocop:disable Cop/ModuleWithInstanceVariables + max_length = @max_step_name_length + 19 # rubocop:disable Gitlab/ModuleWithInstanceVariables out.puts "\n #{'Scenario:'.green} #{name.light_green.ljust(max_length)}" \ " # #{scenario.feature.filename}:#{scenario.line}" end -- cgit v1.2.1 From 4af9d592c500d2d97ec091d10ba860488c3702ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 14 Dec 2017 01:13:44 +0100 Subject: Replace factory_girl_rails with factory_bot_rails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I've followed the [upgrade guide](https://github.com/thoughtbot/factory_bot/blob/4-9-0-stable/UPGRADE_FROM_FACTORY_GIRL.md) and ran these two commands: ``` grep -e FactoryGirl **/*.rake **/*.rb -s -l | xargs sed -i "" "s|FactoryGirl|FactoryBot|" grep -e factory_girl **/*.rake **/*.rb -s -l | xargs sed -i "" "s|factory_girl|factory_bot|" ``` Signed-off-by: Rémy Coutable --- features/support/env.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/support') diff --git a/features/support/env.rb b/features/support/env.rb index 5962745d501..996bb8922e8 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -27,7 +27,7 @@ Spinach.hooks.before_run do # web editor and merge TestEnv.disable_pre_receive - include FactoryGirl::Syntax::Methods + include FactoryBot::Syntax::Methods include GitlabRoutingHelper end -- cgit v1.2.1