Feature #28413 » redmine_project_visibility_class.patch
app/models/project.rb | ||
---|---|---|
635 | 635 |
s << ' closed' |
636 | 636 |
end |
637 | 637 |
end |
638 |
s << (is_public? ? ' public' : ' private') |
|
638 | 639 |
s |
639 | 640 |
end |
640 | 641 |
test/unit/project_test.rb | ||
---|---|---|
1006 | 1006 |
assert_kind_of String, p.css_classes |
1007 | 1007 |
assert_not_include 'archived', p.css_classes.split |
1008 | 1008 |
assert_not_include 'closed', p.css_classes.split |
1009 |
assert_include 'public', p.css_classes.split |
|
1009 | 1010 |
end |
1010 | 1011 | |
1011 | 1012 |
def test_css_classes_for_archived_project |
1012 | 1013 |
p = Project.new |
1013 | 1014 |
p.status = Project::STATUS_ARCHIVED |
1014 | 1015 |
assert_include 'archived', p.css_classes.split |
1016 |
assert_include 'public', p.css_classes.split |
|
1015 | 1017 |
end |
1016 | 1018 | |
1017 | 1019 |
def test_css_classes_for_closed_project |
1018 | 1020 |
p = Project.new |
1019 | 1021 |
p.status = Project::STATUS_CLOSED |
1020 | 1022 |
assert_include 'closed', p.css_classes.split |
1023 |
assert_include 'public', p.css_classes.split |
|
1024 |
end |
|
1025 | ||
1026 |
def test_css_classes_for_private_project |
|
1027 |
p = Project.new |
|
1028 |
p.is_public = false |
|
1029 |
assert_include 'private', p.css_classes.split |
|
1021 | 1030 |
end |
1022 | 1031 | |
1023 | 1032 |
def test_combination_of_visible_and_distinct_scopes_in_case_anonymous_group_has_memberships_should_not_error |