Commit 4be7be6d authored by Winnie Hellmann's avatar Winnie Hellmann

Add JSON fixture for labels autocomplete source

parent 13c723f1
# frozen_string_literal: true
require 'spec_helper'
describe Projects::AutocompleteSourcesController, '(JavaScript fixtures)', type: :controller do
include JavaScriptFixturesHelpers
set(:admin) { create(:admin) }
set(:group) { create(:group, name: 'frontend-fixtures') }
set(:project) { create(:project, namespace: group, path: 'autocomplete-sources-project') }
set(:issue) { create(:issue, project: project) }
before(:all) do
clean_frontend_fixtures('autocomplete_sources/')
end
before do
sign_in(admin)
end
it 'autocomplete_sources/labels.json' do |example|
issue.labels << create(:label, project: project, title: 'bug')
issue.labels << create(:label, project: project, title: 'critical')
create(:label, project: project, title: 'feature')
create(:label, project: project, title: 'documentation')
get :labels,
format: :json,
params: {
namespace_id: group.path,
project_id: project.path,
type: issue.class.name,
type_id: issue.id
}
expect(response).to be_success
store_frontend_fixture(response, example.description)
end
end
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