Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
bc249871
Commit
bc249871
authored
May 29, 2011
by
Eric Davis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#407] Remove deferred Journal#visible tests
parent
8b06e260
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
41 deletions
+0
-41
journal_test.rb
test/unit/journal_test.rb
+0
-41
No files found.
test/unit/journal_test.rb
View file @
bc249871
...
...
@@ -51,47 +51,6 @@ class JournalTest < ActiveSupport::TestCase
assert_equal
1
,
ActionMailer
::
Base
.
deliveries
.
size
end
should_eventually
"test_visible_scope_for_anonymous"
do
# Anonymous user should see issues of public projects only
journals
=
Journal
.
visible
(
User
.
anonymous
).
all
assert
journals
.
any?
assert_nil
journals
.
detect
{
|
journal
|
!
journal
.
issue
.
project
.
is_public?
}
# Anonymous user should not see issues without permission
Role
.
anonymous
.
remove_permission!
(
:view_issues
)
journals
=
Journal
.
visible
(
User
.
anonymous
).
all
assert
journals
.
empty?
end
should_eventually
"test_visible_scope_for_user"
do
user
=
User
.
find
(
9
)
assert
user
.
projects
.
empty?
# Non member user should see issues of public projects only
journals
=
Journal
.
visible
(
user
).
all
assert
journals
.
any?
assert_nil
journals
.
detect
{
|
journal
|
!
journal
.
issue
.
project
.
is_public?
}
# Non member user should not see issues without permission
Role
.
non_member
.
remove_permission!
(
:view_issues
)
user
.
reload
journals
=
Journal
.
visible
(
user
).
all
assert
journals
.
empty?
# User should see issues of projects for which he has view_issues permissions only
Member
.
create!
(
:principal
=>
user
,
:project_id
=>
1
,
:role_ids
=>
[
1
])
user
.
reload
journals
=
Journal
.
visible
(
user
).
all
assert
journals
.
any?
assert_nil
journals
.
detect
{
|
journal
|
journal
.
issue
.
project_id
!=
1
}
end
should_eventually
"test_visible_scope_for_admin"
do
user
=
User
.
find
(
1
)
user
.
members
.
each
(
&
:destroy
)
assert
user
.
projects
.
empty?
journals
=
Journal
.
visible
(
user
).
all
assert
journals
.
any?
# Admin should see issues on private projects that he does not belong to
assert
journals
.
detect
{
|
journal
|
!
journal
.
issue
.
project
.
is_public?
}
end
def
test_create_should_not_send_email_notification_if_told_not_to
ActionMailer
::
Base
.
deliveries
.
clear
issue
=
Issue
.
find
(
:first
)
...
...
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