2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-09-05 11:38:19 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe 'GFM autocomplete loading', :js do
|
2017-08-02 15:55:11 -04:00
|
|
|
let(:project) { create(:project) }
|
2016-09-05 11:38:19 -04:00
|
|
|
|
|
|
|
before do
|
2020-11-23 10:09:37 -05:00
|
|
|
sign_in(project.owner)
|
2016-09-05 11:38:19 -04:00
|
|
|
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_path(project)
|
2016-09-05 11:38:19 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not load on project#show' do
|
2017-05-16 14:42:06 -04:00
|
|
|
expect(evaluate_script('gl.GfmAutoComplete')).to eq(nil)
|
2016-09-05 11:38:19 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'loads on new issue page' do
|
2017-07-06 12:20:50 -04:00
|
|
|
visit new_project_issue_path(project)
|
2016-09-05 11:38:19 -04:00
|
|
|
|
2016-10-12 23:33:09 -04:00
|
|
|
expect(evaluate_script('gl.GfmAutoComplete.dataSources')).not_to eq({})
|
2016-09-05 11:38:19 -04:00
|
|
|
end
|
|
|
|
end
|