parent
adf57a64f1
commit
aa2b0a8709
|
@ -51,7 +51,7 @@ class JournalTest < ActiveSupport::TestCase
|
||||||
assert_equal 1, ActionMailer::Base.deliveries.size
|
assert_equal 1, ActionMailer::Base.deliveries.size
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_visible_scope_for_anonymous
|
should_eventually "test_visible_scope_for_anonymous" do
|
||||||
# Anonymous user should see issues of public projects only
|
# Anonymous user should see issues of public projects only
|
||||||
journals = Journal.visible(User.anonymous).all
|
journals = Journal.visible(User.anonymous).all
|
||||||
assert journals.any?
|
assert journals.any?
|
||||||
|
@ -62,7 +62,7 @@ class JournalTest < ActiveSupport::TestCase
|
||||||
assert journals.empty?
|
assert journals.empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_visible_scope_for_user
|
should_eventually "test_visible_scope_for_user" do
|
||||||
user = User.find(9)
|
user = User.find(9)
|
||||||
assert user.projects.empty?
|
assert user.projects.empty?
|
||||||
# Non member user should see issues of public projects only
|
# Non member user should see issues of public projects only
|
||||||
|
@ -82,7 +82,7 @@ class JournalTest < ActiveSupport::TestCase
|
||||||
assert_nil journals.detect {|journal| journal.issue.project_id != 1}
|
assert_nil journals.detect {|journal| journal.issue.project_id != 1}
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_visible_scope_for_admin
|
should_eventually "test_visible_scope_for_admin" do
|
||||||
user = User.find(1)
|
user = User.find(1)
|
||||||
user.members.each(&:destroy)
|
user.members.each(&:destroy)
|
||||||
assert user.projects.empty?
|
assert user.projects.empty?
|
||||||
|
|
Loading…
Reference in New Issue