gitlab-org--gitlab-foss/spec/javascripts/fixtures/dashboard.rb
Gabriel Mazetto a882026bdf Cleaning up repositories for javascript fixture specs to work correctly
We need to cleanup after each execution so we can still re-use the same
paths and prevent collision with the on disk validation
2017-08-30 20:22:48 +02:00

35 lines
877 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 do
sign_in(admin)
end
after do
remove_repository(project)
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