diff options
author | 2019-12-19 22:40:46 -0800 | |
---|---|---|
committer | 2019-12-19 22:40:46 -0800 | |
commit | 43faf1dd4809cceb87850725c850fb4241280620 (patch) | |
tree | 0524136c094ccb5973883afe338a40ce72bdb439 /test | |
parent | More sudos! (diff) | |
download | packages-5-43faf1dd4809cceb87850725c850fb4241280620.tar.gz packages-5-43faf1dd4809cceb87850725c850fb4241280620.tar.bz2 packages-5-43faf1dd4809cceb87850725c850fb4241280620.zip |
rubocop: autofix
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/integration/about_routes_test.rb | 32 | ||||
-rw-r--r-- | test/integration/arches_routes_test.rb | 31 | ||||
-rw-r--r-- | test/integration/categories_routes_test.rb | 8 | ||||
-rw-r--r-- | test/integration/feeds_test.rb | 10 | ||||
-rw-r--r-- | test/integration/main_routes_test.rb | 9 | ||||
-rw-r--r-- | test/integration/packages_routes_test.rb | 52 | ||||
-rw-r--r-- | test/integration/useflag_routes_test.rb | 26 | ||||
-rw-r--r-- | test/test_helper.rb | 2 |
8 files changed, 79 insertions, 91 deletions
diff --git a/test/integration/about_routes_test.rb b/test/integration/about_routes_test.rb index 56c36a3..5ca8fb6 100644 --- a/test/integration/about_routes_test.rb +++ b/test/integration/about_routes_test.rb @@ -1,30 +1,28 @@ require 'test_helper' class AboutRoutesTest < ActionDispatch::IntegrationTest - - test "can see the about page" do - get "/about" - assert_select "h1", "About packages.gentoo.org" + test 'can see the about page' do + get '/about' + assert_select 'h1', 'About packages.gentoo.org' end - test "can see the feedback page" do - get "/about/feedback" - assert_select "h1", "Feedback" + test 'can see the feedback page' do + get '/about/feedback' + assert_select 'h1', 'Feedback' end - test "can see the about feeds page" do - get "/about/feeds" - assert_select "h1", "Update Feeds" + test 'can see the about feeds page' do + get '/about/feeds' + assert_select 'h1', 'Update Feeds' end - test "can see the about help page" do - get "/about/help" - assert_select "h1", "Help" + test 'can see the about help page' do + get '/about/help' + assert_select 'h1', 'Help' end - test "can see the changelog page" do - get "/about/changelog" - assert_select "h1", "Changelog" + test 'can see the changelog page' do + get '/about/changelog' + assert_select 'h1', 'Changelog' end - end diff --git a/test/integration/arches_routes_test.rb b/test/integration/arches_routes_test.rb index 2e673e2..d654118 100644 --- a/test/integration/arches_routes_test.rb +++ b/test/integration/arches_routes_test.rb @@ -1,25 +1,24 @@ require 'test_helper' class ArchesRoutesTest < ActionDispatch::IntegrationTest - test "can see the arches page" do - get "/arches" - assert_select "h1", "Architectures" + test 'can see the arches page' do + get '/arches' + assert_select 'h1', 'Architectures' end - test "view keyworded packages for arch" do - arches = %w(alpha amd64 arm arm64 hppa ia64 ppc ppc64 sparc x86) - arches.each { |arch| - get ("/arches/" + arch + "/keyworded") - assert_select "h1", ("Keyworded Packages (" + arch + ")") - } + test 'view keyworded packages for arch' do + arches = %w[alpha amd64 arm arm64 hppa ia64 ppc ppc64 sparc x86] + arches.each do |arch| + get ('/arches/' + arch + '/keyworded') + assert_select 'h1', ('Keyworded Packages (' + arch + ')') + end end - test "view stable packages for arch" do - arches = %w(alpha amd64 arm arm64 hppa ia64 ppc ppc64 sparc x86) - arches.each { |arch| - get ("/arches/" + arch + "/stable") - assert_select "h1", ("Newly Stable Packages (" + arch + ")") - } + test 'view stable packages for arch' do + arches = %w[alpha amd64 arm arm64 hppa ia64 ppc ppc64 sparc x86] + arches.each do |arch| + get ('/arches/' + arch + '/stable') + assert_select 'h1', ('Newly Stable Packages (' + arch + ')') + end end - end diff --git a/test/integration/categories_routes_test.rb b/test/integration/categories_routes_test.rb index a9f46c2..49c67a8 100644 --- a/test/integration/categories_routes_test.rb +++ b/test/integration/categories_routes_test.rb @@ -1,10 +1,8 @@ require 'test_helper' class CategoriesRoutesTest < ActionDispatch::IntegrationTest - - test "can see the categories page" do - get "/categories" - assert_select "h1", "Packages" + test 'can see the categories page' do + get '/categories' + assert_select 'h1', 'Packages' end - end diff --git a/test/integration/feeds_test.rb b/test/integration/feeds_test.rb index 12a9c2f..26c13dc 100644 --- a/test/integration/feeds_test.rb +++ b/test/integration/feeds_test.rb @@ -1,29 +1,27 @@ require 'test_helper' class FeedsTest < ActionDispatch::IntegrationTest - - test "can see the added packages feed" do + test 'can see the added packages feed' do get '/packages/added.atom' assert_response :success assert_equal 'application/atom+xml; charset=utf-8', @response.content_type end - test "can see the updates packages feed" do + test 'can see the updates packages feed' do get '/packages/updated.atom' assert_response :success assert_equal 'application/atom+xml; charset=utf-8', @response.content_type end - test "can see the newly stable packages feed" do + test 'can see the newly stable packages feed' do get '/packages/stable.atom' assert_response :success assert_equal 'application/atom+xml; charset=utf-8', @response.content_type end - test "can see the keyworded packages feed" do + test 'can see the keyworded packages feed' do get '/packages/keyworded.atom' assert_response :success assert_equal 'application/atom+xml; charset=utf-8', @response.content_type end - end diff --git a/test/integration/main_routes_test.rb b/test/integration/main_routes_test.rb index 71803aa..7dca74e 100644 --- a/test/integration/main_routes_test.rb +++ b/test/integration/main_routes_test.rb @@ -1,15 +1,14 @@ require 'test_helper' class MainRoutesTest < ActionDispatch::IntegrationTest - test "view landing page" do - get "/" - assert_select "h2", "Welcome to the Home of 1 Gentoo Packages" + test 'view landing page' do + get '/' + assert_select 'h2', 'Welcome to the Home of 1 Gentoo Packages' end - test "test route not present" do + test 'test route not present' do assert_raises(ActionController::RoutingError) do get '/larry' end end - end diff --git a/test/integration/packages_routes_test.rb b/test/integration/packages_routes_test.rb index 465af4b..48b5a12 100644 --- a/test/integration/packages_routes_test.rb +++ b/test/integration/packages_routes_test.rb @@ -1,51 +1,49 @@ require 'test_helper' class PackagesRoutesTest < ActionDispatch::IntegrationTest - - test "packages landing page" do - get "/packages" + test 'packages landing page' do + get '/packages' assert_response :redirect follow_redirect! assert_response :success - assert_select "h1", "Packages" + assert_select 'h1', 'Packages' end - test "view existing package" do - get "/packages/virtual/packages" - assert_select ".kk-package-name", "packages" + test 'view existing package' do + get '/packages/virtual/packages' + assert_select '.kk-package-name', 'packages' end - test "search for non existing package" do - get "/packages/search?q=larry" - assert_select "h2", "Nothing found. :( Try again?" + test 'search for non existing package' do + get '/packages/search?q=larry' + assert_select 'h2', 'Nothing found. :( Try again?' end - test "search for existing package" do - get "/packages/search?q=packages" + test 'search for existing package' do + get '/packages/search?q=packages' assert_response :redirect follow_redirect! assert_response :success - assert_select ".kk-package-name", "packages" + assert_select '.kk-package-name', 'packages' end - test "added package page" do - get "/packages/added" - assert_select "h1", "Added Packages" + test 'added package page' do + get '/packages/added' + assert_select 'h1', 'Added Packages' end - test "updated package page" do - get "/packages/updated" - assert_select "h1", "Updated Packages" + test 'updated package page' do + get '/packages/updated' + assert_select 'h1', 'Updated Packages' end - test "newly stable packages page" do - get "/packages/stable" - assert_select "h1", "Newly Stable Packages" + test 'newly stable packages page' do + get '/packages/stable' + assert_select 'h1', 'Newly Stable Packages' end - test "keyworded packages page" do - get "/packages/keyworded" - assert_select "h1", "Keyworded Packages" + test 'keyworded packages page' do + get '/packages/keyworded' + assert_select 'h1', 'Keyworded Packages' end - -end
\ No newline at end of file +end diff --git a/test/integration/useflag_routes_test.rb b/test/integration/useflag_routes_test.rb index 3ed5718..59a56f6 100644 --- a/test/integration/useflag_routes_test.rb +++ b/test/integration/useflag_routes_test.rb @@ -1,25 +1,23 @@ require 'test_helper' class UseflagRoutesTest < ActionDispatch::IntegrationTest - - test "can see the useflags page" do - get "/useflags" - assert_select "h1", "USE flags" + test 'can see the useflags page' do + get '/useflags' + assert_select 'h1', 'USE flags' end - test "search for multiple existing useflag" do - get "/useflags/search?q=systemd" - assert_select "h1", "USE Flag Search Results for systemd" + test 'search for multiple existing useflag' do + get '/useflags/search?q=systemd' + assert_select 'h1', 'USE Flag Search Results for systemd' end - test "search for non existing useflag" do - get "/useflags/search?q=larry" - assert_select "h1", "USE Flag Search Results for larry" + test 'search for non existing useflag' do + get '/useflags/search?q=larry' + assert_select 'h1', 'USE Flag Search Results for larry' end - test "view existing useflag" do - get "/useflags/systemd" - assert_select "h1", "systemd" + test 'view existing useflag' do + get '/useflags/systemd' + assert_select 'h1', 'systemd' end - end diff --git a/test/test_helper.rb b/test/test_helper.rb index db135c7..43c5d81 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -8,7 +8,7 @@ class ActiveSupport::TestCase Category.new.import!(category) package = Portage::Repository::Package.new('test/fixtures/repo/virtual/packages') - Package.new.import!(package, { package_state: 'new' }) + Package.new.import!(package, package_state: 'new') UseflagsUpdateJob.new.perform # Add more helper methods to be used by all tests here... |