Cmcmahon has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/172404

Change subject: QA update for single quote preference
......................................................................

QA update for single quote preference

Change-Id: I35d22c47abd78a588f622b9b7cd07444c345db5a
---
M .rubocop_todo.yml
M Gemfile
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
M tests/browser/features/support/env.rb
M tests/browser/features/support/hooks.rb
M tests/browser/features/support/pages/article_page.rb
8 files changed, 39 insertions(+), 45 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/04/172404/1

diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 5652fda..64c4ced 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -23,9 +23,3 @@
 Style/GlobalVars:
   Enabled: false
 
-# Offense count: 46
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle, SupportedStyles.
-Style/StringLiterals:
-  Enabled: false
-
diff --git a/Gemfile b/Gemfile
index 977fd62..abeac30 100755
--- a/Gemfile
+++ b/Gemfile
@@ -1,10 +1,10 @@
 # ruby=ruby-2.1.1
 # ruby-gemset=Echo
 
-source "https://rubygems.org";
+source 'https://rubygems.org'
 
-gem "chunky_png"
-gem "csscss"
-gem "mediawiki_api"
-gem "mediawiki_selenium"
-gem "rubocop", require: false
+gem 'chunky_png'
+gem 'csscss'
+gem 'mediawiki_api'
+gem 'mediawiki_selenium'
+gem 'rubocop', require: false
diff --git a/tests/browser/features/step_definitions/common_steps.rb 
b/tests/browser/features/step_definitions/common_steps.rb
index b7c6264..ff87094 100644
--- a/tests/browser/features/step_definitions/common_steps.rb
+++ b/tests/browser/features/step_definitions/common_steps.rb
@@ -7,12 +7,12 @@
 end
 
 def get_session_username_b
-  "EchoUser"
+  'EchoUser'
 end
 
 Given(/^I am logged in as the user "(.*?)"$/) do |username|
   step 'the user "' + username + '" exists'
-  visit(LoginPage).login_with(username, ENV["MEDIAWIKI_PASSWORD"])
+  visit(LoginPage).login_with(username, ENV['MEDIAWIKI_PASSWORD'])
 end
 
 # Note Echo redefines this so that the user is unique to the current browser
@@ -22,7 +22,7 @@
 end
 
 Given(/^I am on the "(.+)" page$/) do |title|
-  on(APIPage).create title, "Test is used by Selenium web driver"
+  on(APIPage).create title, 'Test is used by Selenium web driver'
   visit(ArticlePage, using_params: { article_name: title })
 end
 
@@ -35,27 +35,27 @@
 Given(/^my user rights get changed$/) do
   @username = get_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')
+  client.log_in(ENV['MEDIAWIKI_USER'], ENV['MEDIAWIKI_PASSWORD'])
+  resp = client.query(action: 'query', list: 'users', ususers: @username, 
ustoken: 'userrights')
   data = resp.data
-  @token = data["users"][0]["userrightstoken"]
-  client.action('userrights', token_type: false, token: @token, add: "bot", 
user: @username)
+  @token = data['users'][0]['userrightstoken']
+  client.action('userrights', token_type: false, token: @token, add: 'bot', 
user: @username)
 end
 
 Given(/^the user "(.*?)" exists$/) do |username|
-  on(APIPage).client.log_in(ENV["MEDIAWIKI_USER"], ENV["MEDIAWIKI_PASSWORD"])
+  on(APIPage).client.log_in(ENV['MEDIAWIKI_USER'], ENV['MEDIAWIKI_PASSWORD'])
   begin
-    on(APIPage).client.create_account(username, ENV["MEDIAWIKI_PASSWORD"])
-    puts "Successfully created user " + username
+    on(APIPage).client.create_account(username, ENV['MEDIAWIKI_PASSWORD'])
+    puts 'Successfully created user ' + username
   rescue MediawikiApi::ApiError
     puts 'Assuming in step that user ' + username + ' already exists since was 
unable to create.'
   end
 end
 
 Then(/^I am on the Special Notifications page$/) do
-  expect(@browser.url).to match "Special:Notifications"
+  expect(@browser.url).to match 'Special:Notifications'
 end
 
 Then(/^I see the first heading on the page says Notifications$/) do
-  expect(on(ArticlePage).first_heading_span).to match "Notifications"
+  expect(on(ArticlePage).first_heading_span).to match 'Notifications'
 end
diff --git a/tests/browser/features/step_definitions/messages_steps.rb 
b/tests/browser/features/step_definitions/messages_steps.rb
index eaa8646..0c85baf 100644
--- a/tests/browser/features/step_definitions/messages_steps.rb
+++ b/tests/browser/features/step_definitions/messages_steps.rb
@@ -6,7 +6,7 @@
   client = on(APIPage).client
   username = get_session_username_b
   step 'the user "' + username + '" exists'
-  client.log_in(username, ENV["MEDIAWIKI_PASSWORD"])
+  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.')
 end
diff --git a/tests/browser/features/step_definitions/notifications_steps.rb 
b/tests/browser/features/step_definitions/notifications_steps.rb
index 34b2b4c..d61f95b 100644
--- a/tests/browser/features/step_definitions/notifications_steps.rb
+++ b/tests/browser/features/step_definitions/notifications_steps.rb
@@ -1,13 +1,13 @@
 def make_page_with_user(title, text, username)
   client = on(APIPage).client
-  client.log_in(username, ENV["MEDIAWIKI_PASSWORD"])
+  client.log_in(username, ENV['MEDIAWIKI_PASSWORD'])
   client.create_page(title, text)
 end
 
 def clear_notifications(username)
   client = on(APIPage).client
   step 'the user "' + username + '" exists'
-  client.log_in(username, ENV["MEDIAWIKI_PASSWORD"])
+  client.log_in(username, ENV['MEDIAWIKI_PASSWORD'])
   client.action('echomarkread', token_type: 'edit', all: '1')
 end
 
@@ -30,19 +30,19 @@
 
 Given(/^another user has linked to a page I created from another page$/) do
   title = 'Selenium Echo link test ' + @random_string
-  make_page_with_user_a(title, "Selenium test page. Feel free to delete me.")
+  make_page_with_user_a(title, 'Selenium test page. Feel free to delete me.')
   title2 = title + ' ' + @random_string
-  make_page_with_user_b(title2, "I am linking to [[" + title + "]].")
+  make_page_with_user_b(title2, 'I am linking to [[' + title + ']].')
 end
 
 Given(/^another user writes on my talk page$/) do
-  make_page_with_user_b("User talk:" + get_session_username,
+  make_page_with_user_b('User talk:' + get_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('_', ' ')
-  text = "@" + username + " Cho cho cho. ~~~~"
+  text = '@' + username + ' Cho cho cho. ~~~~'
   make_page_with_user_b(title, text)
 end
 
@@ -73,7 +73,7 @@
   client = on(APIPage).client
   username = get_session_username
   step 'the user "' + username + '" exists'
-  client.log_in(username, ENV["MEDIAWIKI_PASSWORD"])
+  client.log_in(username, ENV['MEDIAWIKI_PASSWORD'])
   client.action('echomarkread', token_type: 'edit', all: '1')
 
   step 'I am logged in my non-shared account'
@@ -81,9 +81,9 @@
 end
 
 Then(/^I have no new notifications$/) do
-  expect(on(ArticlePage).flyout_link_element.when_present.class_name).not_to 
match "mw-echo-unread-notifications"
+  expect(on(ArticlePage).flyout_link_element.when_present.class_name).not_to 
match 'mw-echo-unread-notifications'
 end
 
 Then(/^I have new notifications$/) do
-  expect(on(ArticlePage).flyout_link_element.when_present.class_name).to match 
"mw-echo-unread-notifications"
+  expect(on(ArticlePage).flyout_link_element.when_present.class_name).to match 
'mw-echo-unread-notifications'
 end
diff --git a/tests/browser/features/support/env.rb 
b/tests/browser/features/support/env.rb
index e68b5f3..cdbe1a4 100644
--- a/tests/browser/features/support/env.rb
+++ b/tests/browser/features/support/env.rb
@@ -1,5 +1,5 @@
-require "rubygems"
-require "bundler/setup"
+require 'rubygems'
+require 'bundler/setup'
 
 Bundler.require
 
diff --git a/tests/browser/features/support/hooks.rb 
b/tests/browser/features/support/hooks.rb
index 5ab6259..7da02d5 100644
--- a/tests/browser/features/support/hooks.rb
+++ b/tests/browser/features/support/hooks.rb
@@ -1,3 +1,3 @@
 # Allow running of bundle exec cucumber --dry-run -f stepdefs
-require "mediawiki_selenium"
+require 'mediawiki_selenium'
 require 'page-object'
diff --git a/tests/browser/features/support/pages/article_page.rb 
b/tests/browser/features/support/pages/article_page.rb
index 35675ce..5ad1527 100644
--- a/tests/browser/features/support/pages/article_page.rb
+++ b/tests/browser/features/support/pages/article_page.rb
@@ -1,15 +1,15 @@
 class ArticlePage
   include PageObject
   include URL
-  page_url URL.url("<%=params[:article_name]%><%=params[:hash]%>")
+  page_url URL.url('<%=params[:article_name]%><%=params[:hash]%>')
 
-  span(:first_heading_span, css: "#firstHeading > span:nth-child(1)")
-  li(:flyout_link_container, css: "#pt-notifications")
-  a(:flyout_link, css: "#pt-notifications a")
-  div(:flyout, css: ".mw-echo-overlay")
+  span(:first_heading_span, css: '#firstHeading > span:nth-child(1)')
+  li(:flyout_link_container, css: '#pt-notifications')
+  a(:flyout_link, css: '#pt-notifications a')
+  div(:flyout, css: '.mw-echo-overlay')
 
   # Overlay header
-  a(:alert_tab_link, css: ".mw-echo-overlay-title ul li a", index: 1)
-  button(:mark_as_read, css: ".mw-echo-notifications > button")
-  a(:messages_view_link, css: ".mw-ui-active")
+  a(:alert_tab_link, css: '.mw-echo-overlay-title ul li a', index: 1)
+  button(:mark_as_read, css: '.mw-echo-notifications > button')
+  a(:messages_view_link, css: '.mw-ui-active')
 end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35d22c47abd78a588f622b9b7cd07444c345db5a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon <cmcma...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to