diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-07-26 00:28:08 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-07-27 13:52:45 -0300 |
commit | 7d483f8c03b74c3954319603f01cf8a51ccd461a (patch) | |
tree | 215cc1fcd5746ef456917e2f3c911a9e2342022e | |
parent | 487dfad6acf4175275352094edf418dca6c8cfd6 (diff) | |
download | gitlab-ce-7d483f8c03b74c3954319603f01cf8a51ccd461a.tar.gz |
Add feature specs for edit project settings
-rw-r--r-- | spec/features/projects/project_settings_spec.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/spec/features/projects/project_settings_spec.rb b/spec/features/projects/project_settings_spec.rb new file mode 100644 index 00000000000..5562680d6cc --- /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: 'sample' + expect(page).to have_field 'Path', with: 'gitlab' + 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 |