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

Fixing Tests

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