gitlab-org--gitlab-foss/features/steps/project/project.rb

156 lines
3.9 KiB
Ruby
Raw Normal View History

class Spinach::Features::Project < Spinach::FeatureSteps
2012-09-10 11:35:03 -04:00
include SharedAuthentication
include SharedProject
include SharedPaths
include WaitForRequests
2013-01-09 00:14:05 -05:00
step 'change project settings' do
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
step 'I save project' do
2017-07-28 10:26:25 -04:00
page.within '.general-settings' do
click_button 'Save changes'
end
2013-01-09 00:14:05 -05:00
end
step 'I should see project with new settings' do
expect(find_field('project_name').value).to eq 'NewName'
2013-01-09 00:14:05 -05:00
end
step 'change project path settings' do
fill_in 'project_path', with: 'new-path'
click_button 'Rename'
end
step 'I should see project with new path settings' do
expect(project.path).to eq 'new-path'
end
step 'I change the project avatar' do
attach_file(
:project_avatar,
File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
)
2017-07-28 10:26:25 -04:00
page.within '.general-settings' do
click_button 'Save changes'
end
@project.reload
end
step 'I should see new project avatar' do
expect(@project.avatar).to be_instance_of AvatarUploader
url = @project.avatar.url
2017-07-17 09:46:59 -04:00
expect(url).to eq "/uploads/-/system/project/avatar/#{@project.id}/banana_sample.gif"
end
step 'I should see the "Remove avatar" button' do
expect(page).to have_link('Remove avatar')
end
step 'I have an project avatar' do
attach_file(
:project_avatar,
File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
)
2017-07-28 10:26:25 -04:00
page.within '.general-settings' do
click_button 'Save changes'
end
@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
end
step 'I should not see the "Remove avatar" button' do
expect(page).not_to have_link('Remove avatar')
end
step 'change project default branch' do
2014-07-31 08:39:44 -04:00
select 'fix', from: 'project_default_branch'
2017-07-28 10:26:25 -04:00
page.within '.general-settings' do
click_button 'Save changes'
end
end
step 'I should see project default branch changed' do
expect(find(:css, 'select#project_default_branch').value).to eq 'fix'
end
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
expect(page).to have_content 'Sample repo for testing gitlab features'
end
end
step 'I should see project "Shop" README' do
wait_for_requests
2015-10-18 05:22:40 -04:00
page.within('.readme-holder') do
expect(page).to have_content 'testme'
end
end
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
step 'I should not see "New Issue" button' do
expect(page).not_to have_link 'New Issue'
end
step 'I should not see "New Merge Request" button' do
expect(page).not_to have_link 'New Merge Request'
end
step 'I should not see "Snippets" button' do
page.within '.content' do
expect(page).not_to have_link 'Snippets'
end
end
step 'project "Shop" belongs to group' do
group = create(:group)
@project.namespace = group
@project.save!
end
step 'I click notifications drop down button' do
first('.notifications-btn').click
end
step 'I choose Mention setting' do
click_link 'On mention'
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'
end
end
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