3eedb2aede
Instead of the JS being in charge of the HTML, the HAML now handles it. The HAML can then check the cookie & show it needed. It also allows the HAML access to the paths so we don't have to pass that through. Closes #29955
31 lines
835 B
Ruby
31 lines
835 B
Ruby
require 'spec_helper'
|
|
|
|
describe Dashboard::ProjectsController, '(JavaScript fixtures)', type: :controller do
|
|
include JavaScriptFixturesHelpers
|
|
|
|
let(:admin) { create(:admin) }
|
|
let(:namespace) { create(:namespace, name: 'frontend-fixtures' )}
|
|
let(:project) { create(:project, namespace: namespace, path: 'builds-project') }
|
|
|
|
render_views
|
|
|
|
before(:all) do
|
|
clean_frontend_fixtures('dashboard/')
|
|
end
|
|
|
|
before(:each) do
|
|
sign_in(admin)
|
|
end
|
|
|
|
it 'dashboard/user-callout.html.raw' do |example|
|
|
rendered = render_template('shared/_user_callout')
|
|
store_frontend_fixture(rendered, example.description)
|
|
end
|
|
|
|
private
|
|
|
|
def render_template(template_file_name)
|
|
controller.prepend_view_path(JavaScriptFixturesHelpers::FIXTURE_PATH)
|
|
controller.render_to_string(template_file_name, layout: false)
|
|
end
|
|
end
|