diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-07-28 16:57:42 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-07-28 16:57:42 -0600 |
commit | ce1843b7dea3b63cfced7800612098a766c68e13 (patch) | |
tree | 3340c4b5aca30047c2e22986c15f355bf3f845fe /spec/features | |
parent | 8b1a2e4d0b635c6040cd7e4a7a5870ffae516cb0 (diff) | |
parent | b9b0c0283a001010370741c2683e2fe400bf7599 (diff) | |
download | gitlab-ce-ce1843b7dea3b63cfced7800612098a766c68e13.tar.gz |
Merge branch 'master' into diff-line-comment-vuejs
# Conflicts:
# db/schema.rb
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/issues_spec.rb | 29 | ||||
-rw-r--r-- | spec/features/projects/branches_spec.rb~HEAD | 32 | ||||
-rw-r--r-- | spec/features/projects/project_settings_spec.rb | 41 |
3 files changed, 70 insertions, 32 deletions
diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index d51c9abea19..93dcb2ec3fc 100644 --- a/spec/features/issues_spec.rb +++ b/spec/features/issues_spec.rb @@ -524,6 +524,35 @@ describe 'Issues', feature: true do end end + describe 'new issue by email' do + shared_examples 'show the email in the modal' do + before do + stub_incoming_email_setting(enabled: true, address: "p+%{key}@gl.ab") + + visit namespace_project_issues_path(project.namespace, project) + click_button('Email a new issue') + end + + it 'click the button to show modal for the new email' do + page.within '#issue-email-modal' do + email = project.new_issue_address(@user) + + expect(page).to have_selector("input[value='#{email}']") + end + end + end + + context 'with existing issues' do + let!(:issue) { create(:issue, project: project, author: @user) } + + it_behaves_like 'show the email in the modal' + end + + context 'without existing issues' do + it_behaves_like 'show the email in the modal' + end + end + describe 'due date' do context 'update due on issue#show', js: true do let(:issue) { create(:issue, project: project, author: @user, assignee: @user) } diff --git a/spec/features/projects/branches_spec.rb~HEAD b/spec/features/projects/branches_spec.rb~HEAD deleted file mode 100644 index 79abba21854..00000000000 --- a/spec/features/projects/branches_spec.rb~HEAD +++ /dev/null @@ -1,32 +0,0 @@ -require 'spec_helper' - -describe 'Branches', feature: true do - let(:project) { create(:project) } - let(:repository) { project.repository } - - before do - login_as :user - project.team << [@user, :developer] - end - - describe 'Initial branches page' do - it 'shows all the branches' do - visit namespace_project_branches_path(project.namespace, project) - - repository.branches { |branch| expect(page).to have_content("#{branch.name}") } - expect(page).to have_content("Protected branches can be managed in project settings") - end - end - - describe 'Find branches' do - it 'shows filtered branches', js: true do - visit namespace_project_branches_path(project.namespace, project, project.id) - - fill_in 'branch-search', with: 'fix' - find('#branch-search').native.send_keys(:enter) - - expect(page).to have_content('fix') - expect(find('.all-branches')).to have_selector('li', count: 1) - end - end -end diff --git a/spec/features/projects/project_settings_spec.rb b/spec/features/projects/project_settings_spec.rb new file mode 100644 index 00000000000..3de25d7af7d --- /dev/null +++ b/spec/features/projects/project_settings_spec.rb @@ -0,0 +1,41 @@ +require 'spec_helper' + +describe 'Edit Project Settings', feature: true do + let(:user) { create(:user) } + let(:project) { create(:empty_project, path: 'gitlab', name: 'sample') } + + before do + login_as(user) + project.team << [user, :master] + end + + describe 'Project settings', js: true do + it 'shows errors for invalid project name' do + visit edit_namespace_project_path(project.namespace, project) + + fill_in 'project_name_edit', with: 'foo&bar' + + click_button 'Save changes' + + expect(page).to have_field 'project_name_edit', with: 'foo&bar' + expect(page).to have_content "Name can contain only letters, digits, '_', '.', dash and space. It must start with letter, digit or '_'." + expect(page).to have_button 'Save changes' + end + end + + describe 'Rename repository' do + it 'shows errors for invalid project path/name' do + visit edit_namespace_project_path(project.namespace, project) + + fill_in 'Project name', with: 'foo&bar' + fill_in 'Path', with: 'foo&bar' + + click_button 'Rename project' + + expect(page).to have_field 'Project name', with: 'foo&bar' + expect(page).to have_field 'Path', with: 'foo&bar' + expect(page).to have_content "Name can contain only letters, digits, '_', '.', dash and space. It must start with letter, digit or '_'." + expect(page).to have_content "Path can contain only letters, digits, '_', '-' and '.'. Cannot start with '-', end in '.git' or end in '.atom'" + end + end +end |