jenkins-bot has submitted this change and it was merged.

Change subject: QA: update for rubocop offenses
......................................................................


QA: update for rubocop offenses

Do not name methods starting with "get"

Change-Id: If4adf0c775b031d6a462e00aed8b588077169413
---
M tests/browser/features/step_definitions/common_steps.rb
M tests/browser/features/step_definitions/messages_steps.rb
M tests/browser/features/step_definitions/notifications_steps.rb
3 files changed, 15 insertions(+), 15 deletions(-)

Approvals:
  Zfilipin: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/browser/features/step_definitions/common_steps.rb 
b/tests/browser/features/step_definitions/common_steps.rb
index ff87094..e8d33ad 100644
--- a/tests/browser/features/step_definitions/common_steps.rb
+++ b/tests/browser/features/step_definitions/common_steps.rb
@@ -1,12 +1,12 @@
-def get_new_username
+def new_username
   "EchoUserNew#{@random_string}"
 end
 
-def get_session_username
+def session_username
   "#{ENV['MEDIAWIKI_USER']}_#{@browser.name}"
 end
 
-def get_session_username_b
+def session_username_b
   'EchoUser'
 end
 
@@ -17,7 +17,7 @@
 
 # Note Echo redefines this so that the user is unique to the current browser
 Given(/^I am logged in my non-shared account$/) do
-  username = get_session_username
+  username = session_username
   step 'I am logged in as the user "' + username + '"'
 end
 
@@ -33,7 +33,7 @@
 end
 
 Given(/^my user rights get changed$/) do
-  @username = get_new_username
+  @username = new_username
   client = on(APIPage).client
   client.log_in(ENV['MEDIAWIKI_USER'], ENV['MEDIAWIKI_PASSWORD'])
   resp = client.query(action: 'query', list: 'users', ususers: @username, 
ustoken: 'userrights')
diff --git a/tests/browser/features/step_definitions/messages_steps.rb 
b/tests/browser/features/step_definitions/messages_steps.rb
index 1f277f5..d8d6103 100644
--- a/tests/browser/features/step_definitions/messages_steps.rb
+++ b/tests/browser/features/step_definitions/messages_steps.rb
@@ -4,12 +4,12 @@
 
 Given(/^I have a Flow message that triggers an alert notification$/) do
   client = on(APIPage).client
-  username = get_session_username_b
+  username = session_username_b
   step 'the user "' + username + '" exists'
   client.log_in(username, ENV['MEDIAWIKI_PASSWORD'])
   client.action(
     'flow', token_type: 'edit', submodule: 'new-topic', page: 'Talk:Flow QA', 
nttopic: 'Mention #1',
-            ntcontent: '[[User:' + get_session_username + ']] I wanted to say 
hello.')
+            ntcontent: '[[User:' + session_username + ']] I wanted to say 
hello.')
 end
 
 When(/^I click the mark all as read button$/) do
diff --git a/tests/browser/features/step_definitions/notifications_steps.rb 
b/tests/browser/features/step_definitions/notifications_steps.rb
index c202837..1a6d30b 100644
--- a/tests/browser/features/step_definitions/notifications_steps.rb
+++ b/tests/browser/features/step_definitions/notifications_steps.rb
@@ -12,13 +12,13 @@
 end
 
 def make_page_with_user_b(title, text)
-  username = get_session_username_b
+  username = session_username_b
   step 'the user "' + username + '" exists'
   make_page_with_user(title, text, username)
 end
 
 def make_page_with_user_a(title, text)
-  make_page_with_user(title, text, get_session_username)
+  make_page_with_user(title, text, session_username)
 end
 
 def poll_for_new_notifications(number_of_polls)
@@ -37,13 +37,13 @@
 
 Given(/^another user writes on my talk page$/) do
   make_page_with_user_b(
-    'User talk:' + get_session_username,
+    'User talk:' + session_username,
     "== Barnstar ==\nHello Selenium, here is a barnstar for all your testing! 
" +
     @random_string + "~~~~\n")
 end
 
 Given(/^another user @s me on "(.*?)"$/) do |title|
-  username = get_session_username.sub('_', ' ')
+  username = session_username.sub('_', ' ')
   text = '@' + username + ' Cho cho cho. ~~~~'
   make_page_with_user_b(title, text)
 end
@@ -54,18 +54,18 @@
 
 Given(/^another user mentions me on the wiki$/) do
   title = 'Selenium Echo mention test ' + @random_string
-  username = get_session_username.sub('_', ' ')
+  username = session_username.sub('_', ' ')
   text = "== The walrus ==\n[[User:" +  username + "]]: Cho cho cho. ~~~~\n"
   make_page_with_user_b(title, text)
 end
 
 Given(/^I am logged in as a new user$/) do
-  @username = get_new_username
+  @username = new_username
   step 'I am logged in as the user "' + @username + '"'
 end
 
 Given(/^I am logged in as a new user with no notifications$/) do
-  @username = get_new_username
+  @username = new_username
   clear_notifications(@username)
   step 'I am logged in as the user "' + @username + '"'
 end
@@ -73,7 +73,7 @@
 Given(/^I am logged in with no notifications$/) do
   # Mark all messages as read
   client = on(APIPage).client
-  username = get_session_username
+  username = session_username
   step 'the user "' + username + '" exists'
   client.log_in(username, ENV['MEDIAWIKI_PASSWORD'])
   client.action('echomarkread', token_type: 'edit', all: '1')

-- 
To view, visit https://gerrit.wikimedia.org/r/191905
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If4adf0c775b031d6a462e00aed8b588077169413
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon <[email protected]>
Gerrit-Reviewer: Zfilipin <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to