2014-10-02 12:42:54 -04:00
|
|
|
class Spinach::Features::Project < Spinach::FeatureSteps
|
2012-09-10 11:35:03 -04:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedProject
|
|
|
|
include SharedPaths
|
2013-01-09 00:14:05 -05:00
|
|
|
|
2013-12-23 06:19:13 -05:00
|
|
|
step 'change project settings' do
|
2014-10-28 04:19:58 -04:00
|
|
|
fill_in 'project_name_edit', with: 'NewName'
|
2016-08-01 18:31:21 -04:00
|
|
|
select 'Disabled', from: 'project_project_feature_attributes_issues_access_level'
|
2013-01-09 00:14:05 -05:00
|
|
|
end
|
|
|
|
|
2013-12-23 06:19:13 -05:00
|
|
|
step 'I save project' do
|
2013-08-01 15:35:40 -04:00
|
|
|
click_button 'Save changes'
|
2013-01-09 00:14:05 -05:00
|
|
|
end
|
|
|
|
|
2013-12-23 06:19:13 -05:00
|
|
|
step 'I should see project with new settings' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(find_field('project_name').value).to eq 'NewName'
|
2013-01-09 00:14:05 -05:00
|
|
|
end
|
2013-12-23 06:19:13 -05:00
|
|
|
|
|
|
|
step 'change project path settings' do
|
2014-01-25 12:15:44 -05:00
|
|
|
fill_in 'project_path', with: 'new-path'
|
|
|
|
click_button 'Rename'
|
2013-12-23 06:19:13 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see project with new path settings' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(project.path).to eq 'new-path'
|
2014-01-25 12:15:44 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I change the project avatar' do
|
|
|
|
attach_file(
|
|
|
|
:project_avatar,
|
2015-06-22 14:00:17 -04:00
|
|
|
File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
|
2014-01-25 12:15:44 -05:00
|
|
|
)
|
|
|
|
click_button 'Save changes'
|
|
|
|
@project.reload
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see new project avatar' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(@project.avatar).to be_instance_of AvatarUploader
|
2014-01-25 12:15:44 -05:00
|
|
|
url = @project.avatar.url
|
2015-12-14 21:53:52 -05:00
|
|
|
expect(url).to eq "/uploads/project/avatar/#{@project.id}/banana_sample.gif"
|
2014-01-25 12:15:44 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see the "Remove avatar" button' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_link('Remove avatar')
|
2014-01-25 12:15:44 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I have an project avatar' do
|
|
|
|
attach_file(
|
|
|
|
:project_avatar,
|
2015-06-22 14:00:17 -04:00
|
|
|
File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
|
2014-01-25 12:15:44 -05:00
|
|
|
)
|
|
|
|
click_button 'Save changes'
|
|
|
|
@project.reload
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I remove my project avatar' do
|
|
|
|
click_link 'Remove avatar'
|
|
|
|
@project.reload
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see the default project avatar' do
|
2015-06-18 22:13:32 -04:00
|
|
|
expect(@project.avatar?).to eq false
|
2014-01-25 12:15:44 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should not see the "Remove avatar" button' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).not_to have_link('Remove avatar')
|
2013-12-23 06:19:13 -05:00
|
|
|
end
|
2014-06-25 05:07:06 -04:00
|
|
|
|
|
|
|
step 'I should see project "Shop" version' do
|
2015-06-12 01:36:00 -04:00
|
|
|
page.within '.project-side' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content '6.7.0.pre'
|
2014-06-25 05:07:06 -04:00
|
|
|
end
|
|
|
|
end
|
2014-07-21 15:52:01 -04:00
|
|
|
|
|
|
|
step 'change project default branch' do
|
2014-07-31 08:39:44 -04:00
|
|
|
select 'fix', from: 'project_default_branch'
|
|
|
|
click_button 'Save changes'
|
2014-07-21 15:52:01 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see project default branch changed' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(find(:css, 'select#project_default_branch').value).to eq 'fix'
|
2014-07-21 15:52:01 -04:00
|
|
|
end
|
2014-09-30 08:59:30 -04:00
|
|
|
|
|
|
|
step 'I select project "Forum" README tab' do
|
|
|
|
click_link 'Readme'
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see project "Forum" README' do
|
2015-10-18 05:22:40 -04:00
|
|
|
page.within('.readme-holder') do
|
2015-07-09 08:31:03 -04:00
|
|
|
expect(page).to have_content 'Sample repo for testing gitlab features'
|
|
|
|
end
|
2014-09-30 08:59:30 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see project "Shop" README' do
|
2015-10-18 05:22:40 -04:00
|
|
|
page.within('.readme-holder') do
|
2015-07-09 08:31:03 -04:00
|
|
|
expect(page).to have_content 'testme'
|
|
|
|
end
|
2014-09-30 08:59:30 -04:00
|
|
|
end
|
2015-04-27 09:09:20 -04:00
|
|
|
|
|
|
|
step 'I add project tags' do
|
|
|
|
fill_in 'Tags', with: 'tag1, tag2'
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see project tags' do
|
|
|
|
expect(find_field('Tags').value).to eq 'tag1, tag2'
|
|
|
|
end
|
2015-05-22 06:17:37 -04:00
|
|
|
|
|
|
|
step 'I should not see "New Issue" button' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).not_to have_link 'New Issue'
|
2015-05-22 06:17:37 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should not see "New Merge Request" button' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).not_to have_link 'New Merge Request'
|
2015-05-22 06:17:37 -04:00
|
|
|
end
|
2015-05-27 08:07:44 -04:00
|
|
|
|
|
|
|
step 'I should not see "Snippets" button' do
|
2016-05-16 13:36:27 -04:00
|
|
|
page.within '.content' do
|
|
|
|
expect(page).not_to have_link 'Snippets'
|
|
|
|
end
|
2015-05-27 08:07:44 -04:00
|
|
|
end
|
2015-07-10 07:07:24 -04:00
|
|
|
|
|
|
|
step 'project "Shop" belongs to group' do
|
|
|
|
group = create(:group)
|
|
|
|
@project.namespace = group
|
|
|
|
@project.save!
|
|
|
|
end
|
|
|
|
|
2015-09-16 19:03:48 -04:00
|
|
|
step 'I click notifications drop down button' do
|
2016-05-31 16:51:46 -04:00
|
|
|
first('.notifications-btn').click
|
2015-09-16 19:03:48 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I choose Mention setting' do
|
2015-09-16 20:46:24 -04:00
|
|
|
click_link 'On mention'
|
2015-09-16 19:03:48 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see Notification saved message' do
|
2016-06-13 10:14:58 -04:00
|
|
|
page.within '#notifications-button' do
|
|
|
|
expect(page).to have_content 'On mention'
|
2015-09-16 19:03:48 -04:00
|
|
|
end
|
|
|
|
end
|
2016-02-22 12:37:26 -05:00
|
|
|
|
|
|
|
step 'I create bare repo' do
|
|
|
|
click_link 'Create empty bare repository'
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see command line instructions' do
|
|
|
|
page.within ".empty_wrapper" do
|
|
|
|
expect(page).to have_content("Command line instructions")
|
|
|
|
end
|
|
|
|
end
|
2012-09-10 11:35:03 -04:00
|
|
|
end
|