|  | 
| 140 | 140 |     end | 
| 141 | 141 | 
 | 
| 142 | 142 |     context 'with an experience-cs admin' do | 
| 143 |  | -      let(:user) { build(:experience_cs_admin_user) } | 
|  | 143 | +      let(:user) { build(:experience_cs_admin_user, id: user_id) } | 
|  | 144 | +      let(:another_project) { build(:project) } | 
| 144 | 145 | 
 | 
| 145 |  | -      it { is_expected.to be_able_to(:create, starter_project) } | 
| 146 |  | -      it { is_expected.to be_able_to(:update, starter_project) } | 
| 147 |  | -      it { is_expected.to be_able_to(:destroy, starter_project) } | 
|  | 146 | +      context 'with a starter project' do | 
|  | 147 | +        it { is_expected.to be_able_to(:read, starter_project) } | 
|  | 148 | +        it { is_expected.to be_able_to(:create, starter_project) } | 
|  | 149 | +        it { is_expected.to be_able_to(:update, starter_project) } | 
|  | 150 | +        it { is_expected.to be_able_to(:destroy, starter_project) } | 
|  | 151 | +      end | 
|  | 152 | + | 
|  | 153 | +      context 'with own project' do | 
|  | 154 | +        it { is_expected.to be_able_to(:read, project) } | 
|  | 155 | +        it { is_expected.to be_able_to(:create, project) } | 
|  | 156 | +        it { is_expected.to be_able_to(:update, project) } | 
|  | 157 | +        it { is_expected.to be_able_to(:destroy, project) } | 
|  | 158 | +      end | 
|  | 159 | + | 
|  | 160 | +      context 'with another user\'s project' do | 
|  | 161 | +        it { is_expected.not_to be_able_to(:read, another_project) } | 
|  | 162 | +        it { is_expected.not_to be_able_to(:create, another_project) } | 
|  | 163 | +        it { is_expected.not_to be_able_to(:update, another_project) } | 
|  | 164 | +        it { is_expected.not_to be_able_to(:destroy, another_project) } | 
|  | 165 | +      end | 
| 148 | 166 |     end | 
| 149 | 167 | 
 | 
| 150 | 168 |     # rubocop:disable RSpec/MultipleMemoizedHelpers | 
|  | 
0 commit comments