Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
crabgrass
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
63
Issues
63
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
liberate
crabgrass
Commits
f6df6129
Commit
f6df6129
authored
Aug 28, 2019
by
azul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: add tests from previous dev steps
Used these tests in developing things but forgot to add them.
parent
441b6898
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
test/policies/post_policy_test.rb
test/policies/post_policy_test.rb
+17
-0
test/unit/asset/corrupt_test.rb
test/unit/asset/corrupt_test.rb
+20
-0
No files found.
test/policies/post_policy_test.rb
0 → 100644
View file @
f6df6129
require
'test_helper'
class
PostPolicyTest
<
ActiveSupport
::
TestCase
def
test_admin_may_delete_visitor_comment
admin
=
users
(
:blue
)
visitor
=
users
(
:penguin
)
page
=
FactoryBot
.
create
:page
,
created_by:
admin
,
owner:
groups
(
:rainbow
),
public:
true
visitor_comment
=
page
.
add_post
visitor
,
body:
'test comment by penguin on public page'
policy
=
Pundit
.
policy!
(
admin
,
visitor_comment
)
assert
policy
.
destroy?
end
end
test/unit/asset/corrupt_test.rb
0 → 100644
View file @
f6df6129
require
'test_helper'
class
Asset::PdfTest
<
ActiveSupport
::
TestCase
def
setup
setup_assets
end
def
teardown
teardown_assets
end
def
test_corrupt_file_upload
@asset
=
Asset
.
create_from_params
uploaded_data:
upload_data
(
'corrupt.jpg'
)
@asset
.
generate_thumbnails
@asset
.
thumbnails
.
each
do
|
thumb
|
refute
thumb
.
ok?
,
format
(
'thumbnail "%s" should have failed for corrupt file'
,
thumb
.
name
)
assert
thumb
.
private_filename
,
format
(
'thumbnail "%s" should exist'
,
thumb
.
name
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment