summaryrefslogtreecommitdiff
path: root/spec/features/tags/developer_updates_tag_spec.rb
blob: 1e11fc9e5d5e6cd4de5ea594fe8783e93a4e8484 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
require 'spec_helper'

describe 'Developer updates tag' do
  let(:user) { create(:user) }
  let(:group) { create(:group) }
  let(:project) { create(:project, :repository, namespace: group) }

  before do
    project.add_developer(user)
    sign_in(user)
    visit project_tags_path(project)
  end

  context 'from the tags list page' do
    it 'updates the release notes' do
      page.within(first('.content-list .controls')) do
        click_link 'Edit release notes'
      end

      fill_in 'release_description', with: 'Awesome release notes'
      click_button 'Save changes'

      expect(current_path).to eq(
        project_tag_path(project, 'v1.1.0'))
      expect(page).to have_content 'v1.1.0'
      expect(page).to have_content 'Awesome release notes'
    end

    it 'description has emoji autocomplete', :js do
      page.within(first('.content-list .controls')) do
        click_link 'Edit release notes'
      end

      find('#release_description').native.send_keys('')
      fill_in 'release_description', with: ':'

      expect(page).to have_selector('.atwho-view')
    end
  end

  context 'from a specific tag page' do
    it 'updates the release notes' do
      click_on 'v1.1.0'
      click_link 'Edit release notes'
      fill_in 'release_description', with: 'Awesome release notes'
      click_button 'Save changes'

      expect(current_path).to eq(
        project_tag_path(project, 'v1.1.0'))
      expect(page).to have_content 'v1.1.0'
      expect(page).to have_content 'Awesome release notes'
    end
  end
end