diff options
author | winniehell <git@winniehell.de> | 2017-02-09 22:39:04 +0100 |
---|---|---|
committer | winniehell <git@winniehell.de> | 2017-02-11 20:25:44 +0100 |
commit | dd5f32c1996e91a5ca6f699b093624bff7ddc5b3 (patch) | |
tree | aeb15b3471c86b2436fcf2f0870605407c7d9b8c /spec | |
parent | 534f7f51d53460dea5d6acca5484a6885e2308b7 (diff) | |
download | gitlab-ce-dd5f32c1996e91a5ca6f699b093624bff7ddc5b3.tar.gz |
Replace static fixture for new_branch_spec.js (!9131)
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/fixtures/branches.rb | 28 | ||||
-rw-r--r-- | spec/javascripts/fixtures/new_branch.html.haml | 4 | ||||
-rw-r--r-- | spec/javascripts/new_branch_spec.js | 4 |
3 files changed, 30 insertions, 6 deletions
diff --git a/spec/javascripts/fixtures/branches.rb b/spec/javascripts/fixtures/branches.rb new file mode 100644 index 00000000000..0e7c2351b66 --- /dev/null +++ b/spec/javascripts/fixtures/branches.rb @@ -0,0 +1,28 @@ +require 'spec_helper' + +describe Projects::BranchesController, '(JavaScript fixtures)', type: :controller do + include JavaScriptFixturesHelpers + + let(:admin) { create(:admin) } + let(:namespace) { create(:namespace, name: 'frontend-fixtures' )} + let(:project) { create(:project, :repository, namespace: namespace, path: 'branches-project') } + + render_views + + before(:all) do + clean_frontend_fixtures('branches/') + end + + before(:each) do + sign_in(admin) + end + + it 'branches/new_branch.html.raw' do |example| + get :new, + namespace_id: project.namespace.to_param, + project_id: project.to_param + + expect(response).to be_success + store_frontend_fixture(response, example.description) + end +end diff --git a/spec/javascripts/fixtures/new_branch.html.haml b/spec/javascripts/fixtures/new_branch.html.haml deleted file mode 100644 index f06629e5ecc..00000000000 --- a/spec/javascripts/fixtures/new_branch.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -%form.js-create-branch-form - %input.js-branch-name - .js-branch-name-error - %input{id: "ref"} diff --git a/spec/javascripts/new_branch_spec.js b/spec/javascripts/new_branch_spec.js index 9b657868523..1d014502c2a 100644 --- a/spec/javascripts/new_branch_spec.js +++ b/spec/javascripts/new_branch_spec.js @@ -8,7 +8,7 @@ require('~/new_branch_form'); describe('Branch', function() { return describe('create a new branch', function() { var expectToHaveError, fillNameWith; - preloadFixtures('static/new_branch.html.raw'); + preloadFixtures('branches/new_branch.html.raw'); fillNameWith = function(value) { return $('.js-branch-name').val(value).trigger('blur'); }; @@ -16,7 +16,7 @@ require('~/new_branch_form'); return expect($('.js-branch-name-error span').text()).toEqual(error); }; beforeEach(function() { - loadFixtures('static/new_branch.html.raw'); + loadFixtures('branches/new_branch.html.raw'); $('form').on('submit', function(e) { return e.preventDefault(); }); |