Commit deee4649 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch...

Merge branch '6364-actionview-template-error-undefined-method-present-for-nil-nilclass' into 'master'

Resolve "ActionView::Template::Error: undefined method `present' for nil:NilClass"

Closes #6364

See merge request gitlab-org/gitlab-ee!6064
parents f03ff233 7f43dd74
- namespace = local_assigns.fetch(:namespace) - namespace = local_assigns.fetch(:namespace)
- return unless Gitlab::CurrentSettings.should_check_namespace_plan? && namespace.plan.present - return unless Gitlab::CurrentSettings.should_check_namespace_plan? && namespace.plan.present?
%span.plan-badge.has-tooltip{ data: { plan: namespace.plan.name }, title: "#{namespace.plan.title} Plan" } %span.plan-badge.has-tooltip{ data: { plan: namespace.plan.name }, title: "#{namespace.plan.title} Plan" }
= custom_icon('icon_premium') = custom_icon('icon_premium')
require 'rails_helper' require 'rails_helper'
describe 'admin/users/index' do describe 'admin/users/index' do
it 'includes "Send email to users" link' do let(:should_check_namespace_plan) { false }
before do
allow(Gitlab::CurrentSettings).to receive(:should_check_namespace_plan?)
.and_return(should_check_namespace_plan)
allow(view).to receive(:container_class).and_return('ignored') allow(view).to receive(:container_class).and_return('ignored')
create(:user) # to have at least one usser
assign(:users, User.all.page(1)) assign(:users, User.all.page(1))
render render
end
it 'includes "Send email to users" link' do
expect(rendered).to have_link 'Send email to users', href: admin_email_path expect(rendered).to have_link 'Send email to users', href: admin_email_path
end end
context 'when Gitlab::CurrentSettings.should_check_namespace_plan is true' do
let(:should_check_namespace_plan) { true }
it 'includes "Send email to users" link' do
expect(rendered).to have_link 'Send email to users', href: admin_email_path
end
end
end end
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