debian-mirror-gitlab/features/steps/project/project.rb

155 lines
3.8 KiB
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
class Spinach::Features::Project < Spinach::FeatureSteps
2014-09-02 18:07:02 +05:30
include SharedAuthentication
include SharedProject
include SharedPaths
2017-09-10 17:25:29 +05:30
include WaitForRequests
2014-09-02 18:07:02 +05:30
step 'change project settings' do
2015-04-26 12:48:37 +05:30
fill_in 'project_name_edit', with: 'NewName'
2014-09-02 18:07:02 +05:30
end
step 'I save project' do
2017-09-10 17:25:29 +05:30
page.within '.general-settings' do
click_button 'Save changes'
end
2014-09-02 18:07:02 +05:30
end
step 'I should see project with new settings' do
2015-09-11 14:41:01 +05:30
expect(find_field('project_name').value).to eq 'NewName'
2014-09-02 18:07:02 +05:30
end
step 'change project path settings' do
2015-04-26 12:48:37 +05:30
fill_in 'project_path', with: 'new-path'
click_button 'Rename'
2014-09-02 18:07:02 +05:30
end
step 'I should see project with new path settings' do
2015-09-11 14:41:01 +05:30
expect(project.path).to eq 'new-path'
2014-09-02 18:07:02 +05:30
end
2015-04-26 12:48:37 +05:30
step 'I change the project avatar' do
attach_file(
:project_avatar,
2015-09-11 14:41:01 +05:30
File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
2015-04-26 12:48:37 +05:30
)
2017-09-10 17:25:29 +05:30
page.within '.general-settings' do
click_button 'Save changes'
end
2015-04-26 12:48:37 +05:30
@project.reload
end
step 'I should see new project avatar' do
2015-09-11 14:41:01 +05:30
expect(@project.avatar).to be_instance_of AvatarUploader
2015-04-26 12:48:37 +05:30
url = @project.avatar.url
2017-09-10 17:25:29 +05:30
expect(url).to eq "/uploads/-/system/project/avatar/#{@project.id}/banana_sample.gif"
2015-04-26 12:48:37 +05:30
end
step 'I should see the "Remove avatar" button' do
2015-09-11 14:41:01 +05:30
expect(page).to have_link('Remove avatar')
2015-04-26 12:48:37 +05:30
end
step 'I have an project avatar' do
attach_file(
:project_avatar,
2015-09-11 14:41:01 +05:30
File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
2015-04-26 12:48:37 +05:30
)
2017-09-10 17:25:29 +05:30
page.within '.general-settings' do
click_button 'Save changes'
end
2015-04-26 12:48:37 +05:30
@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-09-11 14:41:01 +05:30
expect(@project.avatar?).to eq false
2015-04-26 12:48:37 +05:30
end
step 'I should not see the "Remove avatar" button' do
2015-09-11 14:41:01 +05:30
expect(page).not_to have_link('Remove avatar')
2014-09-02 18:07:02 +05:30
end
step 'change project default branch' do
select 'fix', from: 'project_default_branch'
2017-09-10 17:25:29 +05:30
page.within '.general-settings' do
click_button 'Save changes'
end
2014-09-02 18:07:02 +05:30
end
step 'I should see project default branch changed' do
2015-09-11 14:41:01 +05:30
expect(find(:css, 'select#project_default_branch').value).to eq 'fix'
2014-09-02 18:07:02 +05:30
end
2015-04-26 12:48:37 +05:30
step 'I select project "Forum" README tab' do
click_link 'Readme'
end
step 'I should see project "Forum" README' do
2015-11-26 14:37:03 +05:30
page.within('.readme-holder') do
2015-09-11 14:41:01 +05:30
expect(page).to have_content 'Sample repo for testing gitlab features'
end
2015-04-26 12:48:37 +05:30
end
step 'I should see project "Shop" README' do
2017-09-10 17:25:29 +05:30
wait_for_requests
2015-11-26 14:37:03 +05:30
page.within('.readme-holder') do
2015-09-11 14:41:01 +05:30
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
2015-09-11 14:41:01 +05:30
end
step 'project "Shop" belongs to group' do
group = create(:group)
@project.namespace = group
@project.save!
end
2015-09-25 12:07:36 +05:30
step 'I click notifications drop down button' do
2016-06-22 15:30:34 +05:30
first('.notifications-btn').click
2015-09-25 12:07:36 +05:30
end
step 'I choose Mention setting' do
click_link 'On mention'
end
step 'I should see Notification saved message' do
2016-06-22 15:30:34 +05:30
page.within '#notifications-button' do
expect(page).to have_content 'On mention'
2015-09-25 12:07:36 +05:30
end
2015-04-26 12:48:37 +05:30
end
2016-06-02 11:05:42 +05:30
step 'I create bare repo' do
2018-05-09 12:01:36 +05:30
click_link 'Create empty repository'
2016-06-02 11:05:42 +05:30
end
step 'I should see command line instructions' do
page.within ".empty_wrapper" do
expect(page).to have_content("Command line instructions")
end
end
2014-09-02 18:07:02 +05:30
end