Commit 5bdcef7b authored by Stan Hu's avatar Stan Hu

Change before(:all) -> let! to avoid leaking data across tests

Closes https://github.com/gitlabhq/gitlabhq/issues/9495
parent 02a15d61
...@@ -36,7 +36,7 @@ describe 'Group access', feature: true do ...@@ -36,7 +36,7 @@ describe 'Group access', feature: true do
subject { group_path(group) } subject { group_path(group) }
context 'with public projects' do context 'with public projects' do
before(:all) { create_project(:public) } let!(:project) { create_project(:public) }
it { is_expected.to be_allowed_for group_member(:owner) } it { is_expected.to be_allowed_for group_member(:owner) }
it { is_expected.to be_allowed_for group_member(:master) } it { is_expected.to be_allowed_for group_member(:master) }
...@@ -48,7 +48,7 @@ describe 'Group access', feature: true do ...@@ -48,7 +48,7 @@ describe 'Group access', feature: true do
end end
context 'with mixed projects' do context 'with mixed projects' do
before(:all) { create_project(:mixed) } let!(:project) { create_project(:mixed) }
it { is_expected.to be_allowed_for group_member(:owner) } it { is_expected.to be_allowed_for group_member(:owner) }
it { is_expected.to be_allowed_for group_member(:master) } it { is_expected.to be_allowed_for group_member(:master) }
...@@ -60,7 +60,7 @@ describe 'Group access', feature: true do ...@@ -60,7 +60,7 @@ describe 'Group access', feature: true do
end end
context 'with internal projects' do context 'with internal projects' do
before(:all) { create_project(:internal) } let!(:project) { create_project(:internal) }
it { is_expected.to be_allowed_for group_member(:owner) } it { is_expected.to be_allowed_for group_member(:owner) }
it { is_expected.to be_allowed_for group_member(:master) } it { is_expected.to be_allowed_for group_member(:master) }
...@@ -86,7 +86,7 @@ describe 'Group access', feature: true do ...@@ -86,7 +86,7 @@ describe 'Group access', feature: true do
subject { issues_group_path(group) } subject { issues_group_path(group) }
context 'with public projects' do context 'with public projects' do
before(:all) { create_project(:public) } let!(:project) { create_project(:public) }
it { is_expected.to be_allowed_for group_member(:owner) } it { is_expected.to be_allowed_for group_member(:owner) }
it { is_expected.to be_allowed_for group_member(:master) } it { is_expected.to be_allowed_for group_member(:master) }
...@@ -98,7 +98,7 @@ describe 'Group access', feature: true do ...@@ -98,7 +98,7 @@ describe 'Group access', feature: true do
end end
context 'with mixed projects' do context 'with mixed projects' do
before(:all) { create_project(:mixed) } let!(:project) { create_project(:mixed) }
it { is_expected.to be_allowed_for group_member(:owner) } it { is_expected.to be_allowed_for group_member(:owner) }
it { is_expected.to be_allowed_for group_member(:master) } it { is_expected.to be_allowed_for group_member(:master) }
...@@ -110,7 +110,7 @@ describe 'Group access', feature: true do ...@@ -110,7 +110,7 @@ describe 'Group access', feature: true do
end end
context 'with internal projects' do context 'with internal projects' do
before(:all) { create_project(:internal) } let!(:project) { create_project(:internal) }
it { is_expected.to be_allowed_for group_member(:owner) } it { is_expected.to be_allowed_for group_member(:owner) }
it { is_expected.to be_allowed_for group_member(:master) } it { is_expected.to be_allowed_for group_member(:master) }
...@@ -136,7 +136,7 @@ describe 'Group access', feature: true do ...@@ -136,7 +136,7 @@ describe 'Group access', feature: true do
subject { merge_requests_group_path(group) } subject { merge_requests_group_path(group) }
context 'with public projects' do context 'with public projects' do
before(:all) { create_project(:public) } let!(:project) { create_project(:public) }
it { is_expected.to be_allowed_for group_member(:owner) } it { is_expected.to be_allowed_for group_member(:owner) }
it { is_expected.to be_allowed_for group_member(:master) } it { is_expected.to be_allowed_for group_member(:master) }
...@@ -148,7 +148,7 @@ describe 'Group access', feature: true do ...@@ -148,7 +148,7 @@ describe 'Group access', feature: true do
end end
context 'with mixed projects' do context 'with mixed projects' do
before(:all) { create_project(:mixed) } let!(:project) { create_project(:mixed) }
it { is_expected.to be_allowed_for group_member(:owner) } it { is_expected.to be_allowed_for group_member(:owner) }
it { is_expected.to be_allowed_for group_member(:master) } it { is_expected.to be_allowed_for group_member(:master) }
...@@ -160,7 +160,7 @@ describe 'Group access', feature: true do ...@@ -160,7 +160,7 @@ describe 'Group access', feature: true do
end end
context 'with internal projects' do context 'with internal projects' do
before(:all) { create_project(:internal) } let!(:project) { create_project(:internal) }
it { is_expected.to be_allowed_for group_member(:owner) } it { is_expected.to be_allowed_for group_member(:owner) }
it { is_expected.to be_allowed_for group_member(:master) } it { is_expected.to be_allowed_for group_member(:master) }
...@@ -186,7 +186,7 @@ describe 'Group access', feature: true do ...@@ -186,7 +186,7 @@ describe 'Group access', feature: true do
subject { group_group_members_path(group) } subject { group_group_members_path(group) }
context 'with public projects' do context 'with public projects' do
before(:all) { create_project(:public) } let!(:project) { create_project(:public) }
it { is_expected.to be_allowed_for group_member(:owner) } it { is_expected.to be_allowed_for group_member(:owner) }
it { is_expected.to be_allowed_for group_member(:master) } it { is_expected.to be_allowed_for group_member(:master) }
...@@ -198,7 +198,7 @@ describe 'Group access', feature: true do ...@@ -198,7 +198,7 @@ describe 'Group access', feature: true do
end end
context 'with mixed projects' do context 'with mixed projects' do
before(:all) { create_project(:mixed) } let!(:project) { create_project(:mixed) }
it { is_expected.to be_allowed_for group_member(:owner) } it { is_expected.to be_allowed_for group_member(:owner) }
it { is_expected.to be_allowed_for group_member(:master) } it { is_expected.to be_allowed_for group_member(:master) }
...@@ -210,7 +210,7 @@ describe 'Group access', feature: true do ...@@ -210,7 +210,7 @@ describe 'Group access', feature: true do
end end
context 'with internal projects' do context 'with internal projects' do
before(:all) { create_project(:internal) } let!(:project) { create_project(:internal) }
it { is_expected.to be_allowed_for group_member(:owner) } it { is_expected.to be_allowed_for group_member(:owner) }
it { is_expected.to be_allowed_for group_member(:master) } it { is_expected.to be_allowed_for group_member(:master) }
...@@ -236,7 +236,7 @@ describe 'Group access', feature: true do ...@@ -236,7 +236,7 @@ describe 'Group access', feature: true do
subject { edit_group_path(group) } subject { edit_group_path(group) }
context 'with public projects' do context 'with public projects' do
before(:all) { create_project(:public) } let!(:project) { create_project(:public) }
it { is_expected.to be_allowed_for group_member(:owner) } it { is_expected.to be_allowed_for group_member(:owner) }
it { is_expected.to be_denied_for group_member(:master) } it { is_expected.to be_denied_for group_member(:master) }
...@@ -248,7 +248,7 @@ describe 'Group access', feature: true do ...@@ -248,7 +248,7 @@ describe 'Group access', feature: true do
end end
context 'with mixed projects' do context 'with mixed projects' do
before(:all) { create_project(:mixed) } let!(:project) { create_project(:mixed) }
it { is_expected.to be_allowed_for group_member(:owner) } it { is_expected.to be_allowed_for group_member(:owner) }
it { is_expected.to be_denied_for group_member(:master) } it { is_expected.to be_denied_for group_member(:master) }
...@@ -260,7 +260,7 @@ describe 'Group access', feature: true do ...@@ -260,7 +260,7 @@ describe 'Group access', feature: true do
end end
context 'with internal projects' do context 'with internal projects' do
before(:all) { create_project(:internal) } let!(:project) { create_project(:internal) }
it { is_expected.to be_allowed_for group_member(:owner) } it { is_expected.to be_allowed_for group_member(:owner) }
it { is_expected.to be_denied_for group_member(:master) } it { is_expected.to be_denied_for group_member(:master) }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment