Auto-approval and upload fixed
This commit is contained in:
parent
0dd63f6bf6
commit
1b299d53e6
5 changed files with 49 additions and 34 deletions
11
test/fixtures/users.yml
vendored
11
test/fixtures/users.yml
vendored
|
|
@ -17,4 +17,13 @@ normal:
|
|||
provider: local
|
||||
admin: 0
|
||||
encrypted_password: <%= Devise::Encryptor.digest(User, 'normalsecret') %>
|
||||
|
||||
|
||||
debian:
|
||||
name: Detlef Debian
|
||||
created_at: 2018-01-01
|
||||
updated_at: 2018-01-01
|
||||
email: detlef@debian.ork
|
||||
sign_in_count: 0
|
||||
provider: debian-sso
|
||||
admin: 0
|
||||
encrypted_password: <%= Devise::Encryptor.digest(User, 'normalsecret') %>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class BrowserBrowseTest < ActionDispatch::IntegrationTest
|
||||
test "upload broken screenshot anonymously" do
|
||||
test "upload broken screenshot anonymously and get error message" do
|
||||
visit package_path(name: 'firefox')
|
||||
click_on 'Upload a screenshot'
|
||||
attach_file 'file[]', Rails.root.join('test/fixtures/files/large-broken.png')
|
||||
|
|
@ -9,7 +9,7 @@ class BrowserBrowseTest < ActionDispatch::IntegrationTest
|
|||
page.must_have_content 'The image large-broken.png is not valid'
|
||||
end
|
||||
|
||||
test "upload png screenshot anonymously" do
|
||||
test "upload png screenshot anonymously and await moderation" do
|
||||
visit package_path(name: 'firefox')
|
||||
click_on 'Upload a screenshot'
|
||||
img_count_before = page.find_all('img').count
|
||||
|
|
@ -26,8 +26,8 @@ class BrowserBrowseTest < ActionDispatch::IntegrationTest
|
|||
newest_screenshot.destroy
|
||||
end
|
||||
|
||||
test "upload screenshot as logged-in user" do
|
||||
sign_in users(:normal)
|
||||
test "upload screenshot as Debian SSO user and get auto-approval" do
|
||||
sign_in users(:debian)
|
||||
visit upload_path(name: 'firefox')
|
||||
img_count_before = page.find_all('img').count
|
||||
attach_file 'file[]', Rails.root.join('test/fixtures/files/large1.png')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue