Commit 62c2cd2d authored by Tim Zallmann's avatar Tim Zallmann

Fixing Tests

parent 5d51ab2a
......@@ -46,13 +46,20 @@ describe Groups::AnalyticsController do
expect(response).to have_http_status(404)
end
it 'returns page when feature is not available and we show promotions' do
stub_licensed_features(contribution_analytics: false)
let!(:license) { nil }
context 'unlicensed but we show promotions' do
before do
allow(License).to receive(:current).and_return(nil)
stub_application_setting(check_namespace_plan: false)
end
get :show, group_id: group.path
it 'returns page when feature is not available and we show promotions' do
stub_licensed_features(contribution_analytics: false)
let!(:license) { nil }
expect(response).to have_http_status(200)
get :show, group_id: group.path
expect(response).to have_http_status(200)
end
end
it 'sets instance variables properly' do
......
......@@ -14,13 +14,19 @@ describe 'layouts/nav/_group' do
expect(rendered).not_to have_text 'Contribution Analytics'
end
it 'is visible when there is no valid license but we show promotions' do
stub_licensed_features(contribution_analytics: false)
let!(:license) { nil }
context 'no license installed' do
before do
allow(License).to receive(:current).and_return(nil)
stub_application_setting(check_namespace_plan: false)
end
render
it 'is visible when there is no valid license but we show promotions' do
stub_licensed_features(contribution_analytics: false)
expect(rendered).to have_text 'Contribution Analytics'
render
expect(rendered).to have_text 'Contribution Analytics'
end
end
it 'is visible' do
......
......@@ -31,7 +31,8 @@ feature 'Projects > Audit Events', :js do
context 'unlicensed but we show promotions' do
before do
stub_licensed_features(audit_events: false)
let!(:license) { nil }
allow(License).to receive(:current).and_return(nil)
stub_application_setting(check_namespace_plan: false)
end
it 'returns 404' do
......
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