Dont test models methods in security specs
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
6304428467
commit
f7ca46b5a3
|
@ -22,11 +22,6 @@ describe "Group access" do
|
||||||
group.add_user(reporter, Gitlab::Access::REPORTER)
|
group.add_user(reporter, Gitlab::Access::REPORTER)
|
||||||
group.add_user(guest, Gitlab::Access::GUEST)
|
group.add_user(guest, Gitlab::Access::GUEST)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "Group should not have accessible projects" do
|
|
||||||
it { group.has_projects_accessible_to?(nil).should be_false }
|
|
||||||
it { group.has_projects_accessible_to?(nonmember).should be_false }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "GET /groups/:path" do
|
describe "GET /groups/:path" do
|
||||||
subject { group_path(group) }
|
subject { group_path(group) }
|
||||||
|
|
|
@ -15,14 +15,9 @@ describe "Group with internal project access" do
|
||||||
group.add_user(master, Gitlab::Access::MASTER)
|
group.add_user(master, Gitlab::Access::MASTER)
|
||||||
group.add_user(reporter, Gitlab::Access::REPORTER)
|
group.add_user(reporter, Gitlab::Access::REPORTER)
|
||||||
group.add_user(guest, Gitlab::Access::GUEST)
|
group.add_user(guest, Gitlab::Access::GUEST)
|
||||||
|
|
||||||
create(:project, group: group, visibility_level: Gitlab::VisibilityLevel::INTERNAL)
|
create(:project, group: group, visibility_level: Gitlab::VisibilityLevel::INTERNAL)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "Group should have accessible projects for users" do
|
|
||||||
it { group.has_projects_accessible_to?(nil).should be_false }
|
|
||||||
it { group.has_projects_accessible_to?(nonmember).should be_true }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "GET /groups/:path" do
|
describe "GET /groups/:path" do
|
||||||
subject { group_path(group) }
|
subject { group_path(group) }
|
||||||
|
|
|
@ -19,11 +19,6 @@ describe "Group access" do
|
||||||
create(:project, path: "internal_project", group: group, visibility_level: Gitlab::VisibilityLevel::INTERNAL)
|
create(:project, path: "internal_project", group: group, visibility_level: Gitlab::VisibilityLevel::INTERNAL)
|
||||||
create(:project, path: "public_project", group: group, visibility_level: Gitlab::VisibilityLevel::PUBLIC)
|
create(:project, path: "public_project", group: group, visibility_level: Gitlab::VisibilityLevel::PUBLIC)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "Group should have accessible projects" do
|
|
||||||
it { group.has_projects_accessible_to?(nil).should be_true }
|
|
||||||
it { group.has_projects_accessible_to?(nonmember).should be_true }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "GET /groups/:path" do
|
describe "GET /groups/:path" do
|
||||||
subject { group_path(group) }
|
subject { group_path(group) }
|
||||||
|
|
|
@ -15,13 +15,8 @@ describe "Group with public project access" do
|
||||||
group.add_user(master, Gitlab::Access::MASTER)
|
group.add_user(master, Gitlab::Access::MASTER)
|
||||||
group.add_user(reporter, Gitlab::Access::REPORTER)
|
group.add_user(reporter, Gitlab::Access::REPORTER)
|
||||||
group.add_user(guest, Gitlab::Access::GUEST)
|
group.add_user(guest, Gitlab::Access::GUEST)
|
||||||
|
|
||||||
create(:project, group: group, visibility_level: Gitlab::VisibilityLevel::PUBLIC)
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "Group should have accessible projects" do
|
create(:project, group: group, visibility_level: Gitlab::VisibilityLevel::PUBLIC)
|
||||||
it { group.has_projects_accessible_to?(nil).should be_true }
|
|
||||||
it { group.has_projects_accessible_to?(nonmember).should be_true }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "GET /groups/:path" do
|
describe "GET /groups/:path" do
|
||||||
|
|
Loading…
Reference in New Issue