diff --git a/.rubocop.yml b/.rubocop.yml deleted file mode 100644 index 3c8a65056..000000000 --- a/.rubocop.yml +++ /dev/null @@ -1,22 +0,0 @@ -inherit_from: .rubocop_todo.yml - -AllCops: - StyleGuideCopsOnly: true - -Metrics/LineLength: - Max: 100 - -Metrics/MethodLength: - Enabled: false - -Style/Alias: - Enabled: false - -Style/SignalException: - Enabled: false - -Style/StringLiterals: - EnforcedStyle: single_quotes - -Style/TrivialAccessors: - ExactNameMatch: true diff --git a/Rakefile b/Rakefile deleted file mode 100644 index 5ac9aba4f..000000000 --- a/Rakefile +++ /dev/null @@ -1,19 +0,0 @@ -require 'bundler/setup' - -require 'rubocop/rake_task' -RuboCop::RakeTask.new(:rubocop) do |task| - # if you use mediawiki-vagrant, rubocop will by default use it's .rubocop.yml - # the next line makes it explicit that you want .rubocop.yml from the directory - # where `bundle exec rake` is executed - task.options = ['-c', '.rubocop.yml'] -end - -require 'rspec/core/rake_task' -RSpec::Core::RakeTask.new do |t| - t.rspec_opts = 'tests/rspec/' -end - -task default: [:test] - -desc 'Run all build/tests commands (CI entry point)' -task test: [:rubocop, :spec] diff --git a/tests/rspec/README.md b/tests/rspec/README.md deleted file mode 100644 index 5cf77fbf5..000000000 --- a/tests/rspec/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Usage - - vagrant up - vagrant roles enable echo flow wikimediaflow - vagrant provision - bundle install - bundle exec rake spec diff --git a/tests/rspec/notification_spec.rb b/tests/rspec/notification_spec.rb deleted file mode 100644 index 1d965165f..000000000 --- a/tests/rspec/notification_spec.rb +++ /dev/null @@ -1,55 +0,0 @@ -require 'mediawiki_api' - -describe 'Echo' do - before(:all) do - if ENV['JENKINS_HOME'] - # jenkins - @mediawiki_api = "#{ENV['MW_SERVER']}#{ENV['MW_SCRIPT_PATH']}/api.php" - @admin_username = "#{ENV['MEDIAWIKI_USER']}" - @admin_password = "#{ENV['MEDIAWIKI_PASSWORD']}" - else - # mediawiki-vagrant - @mediawiki_api = 'http://127.0.0.1:8080/w/api.php' - @admin_username = 'Admin' - @admin_password = 'vagrant' - end - - @client = MediawikiApi::Client.new @mediawiki_api - end - - before(:each) do - @client.log_in @admin_username, @admin_password - - require 'securerandom' - @random_username = "U#{SecureRandom.hex(5)}" - @random_password = SecureRandom.hex(5) - end - - it 'should notify a new user with welcome message' do - @client.create_account(@random_username, @random_password) - - @client.log_in @random_username, @random_password - notifications = @client.query(meta: 'notifications').data['notifications']['list'] - - welcome_notification = notifications.first - expect(welcome_notification['type']).to eq 'welcome' - expect(welcome_notification['agent']['name']).to eq @random_username - expect(welcome_notification['timestamp']['date']).to eq 'Today' - end - - it 'should notify user about mention on wikitext page' do - @client.create_account(@random_username, @random_password) - - page = SecureRandom.hex(5).capitalize - @client.edit(title: page, text: "[[User:#{@random_username}]] ~~~~") - - @client.log_in @random_username, @random_password - notifications = @client.query(meta: 'notifications').data['notifications']['list'] - - mention_notification = notifications.last - expect(mention_notification['type']).to eq 'mention' - expect(mention_notification['agent']['name']).to eq @admin_username - expect(mention_notification['title']['full']).to eq page - end - -end