Commit dd5f32c1 authored by winniehell's avatar winniehell

Replace static fixture for new_branch_spec.js (!9131)

parent 534f7f51
---
title: Replace static fixture for new_branch_spec.js
merge_request: 9131
author: winniehell
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
%form.js-create-branch-form
%input.js-branch-name
.js-branch-name-error
%input{id: "ref"}
......@@ -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();
});
......
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