QA: update for rubocop offenses

Do not name methods starting with "get"

Change-Id: If4adf0c775b031d6a462e00aed8b588077169413
This commit is contained in:
Cmcmahon 2015-02-20 10:00:01 -07:00
parent 60a0e05c7c
commit 7d607dbfb6
3 changed files with 15 additions and 15 deletions

View file

@ -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 @@ end
# 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 @@ Given(/^I am using user agent "(.+)"$/) do |user_agent|
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')

View file

@ -4,12 +4,12 @@ end
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

View file

@ -12,13 +12,13 @@ def clear_notifications(username)
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 @@ end
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 @@ end
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 @@ end
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')