summaryrefslogtreecommitdiff
path: root/spec/javascripts/fixtures/dashboard.rb
blob: e83db8daaf202ebeb81e3e7de03a603d58d63f30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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