Welcome to mirror list, hosted at ThFree Co, Russian Federation.

inline_edit_spec.rb « issues « features « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a206f5fa646305a54dc3b82665bfa3043d46733c (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
32
33
34
35
36
37
require 'rails_helper'

describe 'Issue inline editing', feature: true, js: true do
  let(:project)   { create(:project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) }
  let(:user)      { create(:user) }
  let(:issue)     { create(:issue, project: project, description: 'description') }

  context 'user is allowed to edit issue' do
    before do
      project.team << [user, :master]
      login_as(user)
      visit namespace_project_issue_path(project.namespace, project, issue)
    end

    it 'allows user to update title and description' do
      find('.js-inline-edit').click

      fill_in 'issue_title', with: 'title test'
      fill_in 'issue_description', with: 'description test'

      click_button 'Save changes'
      expect(page).to have_content 'title test'
      expect(page).to have_content 'description test'
    end
  end

  context 'user is not allowed to edit issue' do
    before do
      login_as(user)
      visit namespace_project_issue_path(project.namespace, project, issue)
    end

    it 'does not allow editing of title' do
      expect(page).not_to have_selector('.js-inline-edit', visible: false)
    end
  end
end