rubocop
This commit is contained in:
parent
d40d2ff164
commit
e1f42aee0c
3 changed files with 19 additions and 20 deletions
|
|
@ -1,13 +1,13 @@
|
|||
require 'test_helper'
|
||||
|
||||
class PackagesControllerTest < ActionController::TestCase
|
||||
test "should get index and contain dummy package-4" do
|
||||
test 'should get index and contain dummy package-4' do
|
||||
get :grid
|
||||
assert_response :success
|
||||
assert_select 'div', 'package-4'
|
||||
end
|
||||
|
||||
test "should get list view with_screenshots and find Firefox" do
|
||||
test 'should get list view with_screenshots and find Firefox' do
|
||||
# package = Package.create!(name: 'firefox', description: 'A web browser.')
|
||||
# Screenshot.create!(package: package, approved: true, hidden: false)
|
||||
|
||||
|
|
@ -20,7 +20,12 @@ class PackagesControllerTest < ActionController::TestCase
|
|||
assert_select 'div', 'A program to browse web sites.'
|
||||
end
|
||||
|
||||
# test "should get without_screenshots" do
|
||||
# test 'should get thumbnail for a package and a desired version' do
|
||||
# # get '/thumbnail-with-version/package-5/0.1'
|
||||
# get thumbnail_with_version_url('package-5', '0.1')
|
||||
# end
|
||||
|
||||
# test 'should get without_screenshots' do
|
||||
# get :without_screenshots
|
||||
# assert_response :success
|
||||
# end
|
||||
|
|
@ -56,7 +61,6 @@ class PackagesControllerTest < ActionController::TestCase
|
|||
# byebug
|
||||
# assert_equal newest_screenshot2.user, users(:normal)
|
||||
|
||||
|
||||
# # (name: 'firefox')
|
||||
# # img_count_before = page.find_all('img').count
|
||||
# # attach_file 'file[]', Rails.root.join('test/fixtures/files/large1.png')
|
||||
|
|
@ -77,5 +81,4 @@ class PackagesControllerTest < ActionController::TestCase
|
|||
# # newest_screenshot.destroy
|
||||
# # sign_out users(:normal)
|
||||
# end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
require "application_system_test_case"
|
||||
require 'application_system_test_case'
|
||||
|
||||
class BrowsesTest < ApplicationSystemTestCase
|
||||
# test "visiting the index" do
|
||||
|
|
@ -7,14 +7,13 @@ class BrowsesTest < ApplicationSystemTestCase
|
|||
# assert_selector "h1", text: "Browse"
|
||||
# end
|
||||
|
||||
test "user can see home page" do
|
||||
test 'user can see home page' do
|
||||
visit root_path
|
||||
assert_text /This website lets you browse screenshots of [\d,]+ software packages/
|
||||
assert_text(/This website lets you browse screenshots of [\d,]+ software packages/)
|
||||
end
|
||||
|
||||
test "user can browse packages" do
|
||||
test 'user can browse packages' do
|
||||
visit packages_grid_path
|
||||
has_link? href: packages_grid_path(page: 2)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
require "application_system_test_case"
|
||||
require 'application_system_test_case'
|
||||
|
||||
class UploadsTest < ApplicationSystemTestCase
|
||||
test "upload broken screenshot anonymously and get error message" do
|
||||
test 'upload broken screenshot anonymously and get error message' do
|
||||
visit package_path(name: 'firefox')
|
||||
click_on 'Upload a screenshot'
|
||||
# The actual file field is hidden in favor of a more beautiful button -> visible=false
|
||||
|
|
@ -10,7 +10,7 @@ class UploadsTest < ApplicationSystemTestCase
|
|||
assert_text 'large-broken.png must be a valid'
|
||||
end
|
||||
|
||||
test "upload png screenshot anonymously and await moderation" do
|
||||
test 'upload png screenshot anonymously and await moderation' do
|
||||
visit package_path(name: 'firefox')
|
||||
img_count1 = page.find_all('img').count
|
||||
# Rails::logger.debug "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 1=#{img_count1}"
|
||||
|
|
@ -45,8 +45,7 @@ class UploadsTest < ApplicationSystemTestCase
|
|||
assert_equal img_count3, img_count1
|
||||
end
|
||||
|
||||
test "upload png screenshot as moderator and expect auto-approval" do
|
||||
|
||||
test 'upload png screenshot as moderator and expect auto-approval' do
|
||||
# Delete all screenshots for the Firefox package
|
||||
Package.find_by_name(:firefox).screenshots.delete_all
|
||||
|
||||
|
|
@ -83,7 +82,6 @@ class UploadsTest < ApplicationSystemTestCase
|
|||
assert page.has_content?('Homepage')
|
||||
end
|
||||
|
||||
|
||||
# test "upload screenshot as Debian SSO user and get auto-approval" do
|
||||
# sign_in users(:debian)
|
||||
# visit upload_path(name: 'firefox')
|
||||
|
|
@ -128,5 +126,4 @@ class UploadsTest < ApplicationSystemTestCase
|
|||
# newest_screenshot.destroy
|
||||
# sign_out users(:debian)
|
||||
# end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue