diff options
Diffstat (limited to 'features/steps')
83 files changed, 0 insertions, 6933 deletions
diff --git a/features/steps/admin/active_tab.rb b/features/steps/admin/active_tab.rb deleted file mode 100644 index 90d13abdb13..00000000000 --- a/features/steps/admin/active_tab.rb +++ /dev/null @@ -1,37 +0,0 @@ -class Spinach::Features::AdminActiveTab < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedActiveTab - - step 'the active main tab should be Home' do - ensure_active_main_tab('Overview') - end - - step 'the active main tab should be Projects' do - ensure_active_main_tab('Projects') - end - - step 'the active main tab should be Groups' do - ensure_active_main_tab('Groups') - end - - step 'the active main tab should be Users' do - ensure_active_main_tab('Users') - end - - step 'the active main tab should be Logs' do - ensure_active_main_tab('Logs') - end - - step 'the active main tab should be Hooks' do - ensure_active_main_tab('Hooks') - end - - step 'the active main tab should be Resque' do - ensure_active_main_tab('Background Jobs') - end - - step 'the active main tab should be Messages' do - ensure_active_main_tab('Messages') - end -end diff --git a/features/steps/admin/applications.rb b/features/steps/admin/applications.rb deleted file mode 100644 index d59088fa3c3..00000000000 --- a/features/steps/admin/applications.rb +++ /dev/null @@ -1,55 +0,0 @@ -class Spinach::Features::AdminApplications < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - - step 'I click on new application button' do - click_on 'New Application' - end - - step 'I should see application form' do - page.should have_content "New application" - end - - step 'I fill application form out and submit' do - fill_in :doorkeeper_application_name, with: 'test' - fill_in :doorkeeper_application_redirect_uri, with: 'https://test.com' - click_on "Submit" - end - - step 'I see application' do - page.should have_content "Application: test" - page.should have_content "Application Id" - page.should have_content "Secret" - end - - step 'I click edit' do - click_on "Edit" - end - - step 'I see edit application form' do - page.should have_content "Edit application" - end - - step 'I change name of application and submit' do - page.should have_content "Edit application" - fill_in :doorkeeper_application_name, with: 'test_changed' - click_on "Submit" - end - - step 'I see that application was changed' do - page.should have_content "test_changed" - page.should have_content "Application Id" - page.should have_content "Secret" - end - - step 'I click to remove application' do - within '.oauth-applications' do - click_on "Destroy" - end - end - - step "I see that application is removed" do - page.find(".oauth-applications").should_not have_content "test_changed" - end -end diff --git a/features/steps/admin/broadcast_messages.rb b/features/steps/admin/broadcast_messages.rb deleted file mode 100644 index a35fa34a3a2..00000000000 --- a/features/steps/admin/broadcast_messages.rb +++ /dev/null @@ -1,41 +0,0 @@ -class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - - step 'application already has admin messages' do - FactoryGirl.create(:broadcast_message, message: "Migration to new server") - end - - step 'I should be all broadcast messages' do - page.should have_content "Migration to new server" - end - - step 'submit form with new broadcast message' do - fill_in 'broadcast_message_message', with: 'Application update from 4:00 CST to 5:00 CST' - select '2018', from: "broadcast_message_ends_at_1i" - click_button "Add broadcast message" - end - - step 'I should be redirected to admin messages page' do - current_path.should == admin_broadcast_messages_path - end - - step 'I should see newly created broadcast message' do - page.should have_content 'Application update from 4:00 CST to 5:00 CST' - end - - step 'submit form with new customized broadcast message' do - fill_in 'broadcast_message_message', with: 'Application update from 4:00 CST to 5:00 CST' - click_link "Customize colors" - fill_in 'broadcast_message_color', with: '#f2dede' - fill_in 'broadcast_message_font', with: '#b94a48' - select '2018', from: "broadcast_message_ends_at_1i" - click_button "Add broadcast message" - end - - step 'I should see a customized broadcast message' do - page.should have_content 'Application update from 4:00 CST to 5:00 CST' - page.should have_selector %(div[style="background-color:#f2dede;color:#b94a48"]) - end -end diff --git a/features/steps/admin/deploy_keys.rb b/features/steps/admin/deploy_keys.rb deleted file mode 100644 index fb0b611762e..00000000000 --- a/features/steps/admin/deploy_keys.rb +++ /dev/null @@ -1,57 +0,0 @@ -class Spinach::Features::AdminDeployKeys < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - - step 'there are public deploy keys in system' do - create(:deploy_key, public: true) - create(:another_deploy_key, public: true) - end - - step 'I should see all public deploy keys' do - DeployKey.are_public.each do |p| - page.should have_content p.title - end - end - - step 'I click on first deploy key' do - click_link DeployKey.are_public.first.title - end - - step 'I should see deploy key details' do - deploy_key = DeployKey.are_public.first - current_path.should == admin_deploy_key_path(deploy_key) - page.should have_content(deploy_key.title) - page.should have_content(deploy_key.key) - end - - step 'I visit admin deploy key page' do - visit admin_deploy_key_path(deploy_key) - end - - step 'I visit admin deploy keys page' do - visit admin_deploy_keys_path - end - - step 'I click \'New Deploy Key\'' do - click_link 'New Deploy Key' - end - - step 'I submit new deploy key' do - fill_in "deploy_key_title", with: "laptop" - fill_in "deploy_key_key", with: "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop" - click_button "Create" - end - - step 'I should be on admin deploy keys page' do - current_path.should == admin_deploy_keys_path - end - - step 'I should see newly created deploy key' do - page.should have_content(deploy_key.title) - end - - def deploy_key - @deploy_key ||= DeployKey.are_public.first - end -end diff --git a/features/steps/admin/groups.rb b/features/steps/admin/groups.rb deleted file mode 100644 index 721460b9371..00000000000 --- a/features/steps/admin/groups.rb +++ /dev/null @@ -1,85 +0,0 @@ -class Spinach::Features::AdminGroups < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedUser - include SharedActiveTab - include Select2Helper - - When 'I visit admin group page' do - visit admin_group_path(current_group) - end - - When 'I click new group link' do - click_link "New Group" - end - - step 'I have group with projects' do - @group = create(:group) - @project = create(:project, group: @group) - @event = create(:closed_issue_event, project: @project) - - @project.team << [current_user, :master] - end - - step 'submit form with new group info' do - fill_in 'group_path', with: 'gitlab' - fill_in 'group_description', with: 'Group description' - click_button "Create group" - end - - step 'I should see newly created group' do - page.should have_content "Group: gitlab" - page.should have_content "Group description" - end - - step 'I should be redirected to group page' do - current_path.should == admin_group_path(Group.find_by(path: 'gitlab')) - end - - When 'I select user "John Doe" from user list as "Reporter"' do - select2(user_john.id, from: "#user_ids", multiple: true) - within "#new_project_member" do - select "Reporter", from: "access_level" - end - click_button "Add users to group" - end - - step 'I should see "John Doe" in team list in every project as "Reporter"' do - within ".group-users-list" do - page.should have_content "John Doe" - page.should have_content "Reporter" - end - end - - step 'I should be all groups' do - Group.all.each do |group| - page.should have_content group.name - end - end - - step 'we have user "John Doe" in group' do - current_group.add_user(user_john, Gitlab::Access::REPORTER) - end - - step 'I remove user "John Doe" from group' do - within "#user_#{user_john.id}" do - click_link 'Remove user from group' - end - end - - step 'I should not see "John Doe" in team list' do - within ".group-users-list" do - page.should_not have_content "John Doe" - end - end - - protected - - def current_group - @group ||= Group.first - end - - def user_john - @user_john ||= User.find_by(name: "John Doe") - end -end diff --git a/features/steps/admin/logs.rb b/features/steps/admin/logs.rb deleted file mode 100644 index 904e5468655..00000000000 --- a/features/steps/admin/logs.rb +++ /dev/null @@ -1,11 +0,0 @@ -class Spinach::Features::AdminLogs < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - - step 'I should see tabs with available logs' do - page.should have_content 'production.log' - page.should have_content 'githost.log' - page.should have_content 'application.log' - end -end diff --git a/features/steps/admin/projects.rb b/features/steps/admin/projects.rb deleted file mode 100644 index 9be4d39d2d5..00000000000 --- a/features/steps/admin/projects.rb +++ /dev/null @@ -1,48 +0,0 @@ -class Spinach::Features::AdminProjects < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - - step 'I should see all projects' do - Project.all.each do |p| - page.should have_content p.name_with_namespace - end - end - - step 'I click on first project' do - click_link Project.first.name_with_namespace - end - - step 'I should see project details' do - project = Project.first - current_path.should == admin_namespace_project_path(project.namespace, project) - page.should have_content(project.name_with_namespace) - page.should have_content(project.creator.name) - end - - step 'I visit admin project page' do - visit admin_namespace_project_path(project.namespace, project) - end - - step 'I transfer project to group \'Web\'' do - find(:xpath, "//input[@id='new_namespace_id']").set group.id - click_button 'Transfer' - end - - step 'group \'Web\'' do - create(:group, name: 'Web') - end - - step 'I should see project transfered' do - page.should have_content 'Web / ' + project.name - page.should have_content 'Namespace: Web' - end - - def project - @project ||= Project.first - end - - def group - Group.find_by(name: 'Web') - end -end diff --git a/features/steps/admin/settings.rb b/features/steps/admin/settings.rb deleted file mode 100644 index 87d4e969ff5..00000000000 --- a/features/steps/admin/settings.rb +++ /dev/null @@ -1,47 +0,0 @@ -class Spinach::Features::AdminSettings < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - include Gitlab::CurrentSettings - - step 'I modify settings and save form' do - uncheck 'Gravatar enabled' - fill_in 'Home page url', with: 'https://about.gitlab.com/' - click_button 'Save' - end - - step 'I should see application settings saved' do - current_application_settings.gravatar_enabled.should be_false - current_application_settings.home_page_url.should == 'https://about.gitlab.com/' - page.should have_content 'Application settings saved successfully' - end - - step 'I click on "Service Templates"' do - click_link 'Service Templates' - end - - step 'I click on "Slack" service' do - click_link 'Slack' - end - - step 'I check all events and submit form' do - page.check('Active') - page.check('Push events') - page.check('Tag push events') - page.check('Comments') - page.check('Issues events') - page.check('Merge Request events') - fill_in 'Webhook', with: "http://localhost" - click_on 'Save' - end - - step 'I should see service template settings saved' do - page.should have_content 'Application settings saved successfully' - end - - step 'I should see all checkboxes checked' do - all('input[type=checkbox]').each do |checkbox| - checkbox.should be_checked - end - end -end diff --git a/features/steps/admin/users.rb b/features/steps/admin/users.rb deleted file mode 100644 index e1383097248..00000000000 --- a/features/steps/admin/users.rb +++ /dev/null @@ -1,117 +0,0 @@ -class Spinach::Features::AdminUsers < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - - step 'I should see all users' do - User.all.each do |user| - page.should have_content user.name - end - end - - step 'Click edit' do - @user = User.first - find("#edit_user_#{@user.id}").click - end - - step 'Input non ascii char in username' do - fill_in 'user_username', with: "\u3042\u3044" - end - - step 'Click save' do - click_button("Save") - end - - step 'See username error message' do - within "#error_explanation" do - page.should have_content "Username" - end - end - - step 'Not changed form action url' do - page.should have_selector %(form[action="/admin/users/#{@user.username}"]) - end - - step 'I submit modified user' do - check :user_can_create_group - click_button 'Save' - end - - step 'I see user attributes changed' do - page.should have_content 'Can create groups: Yes' - end - - step 'click edit on my user' do - find("#edit_user_#{current_user.id}").click - end - - step 'I view the user with secondary email' do - @user_with_secondary_email = User.last - @user_with_secondary_email.emails.new(email: "secondary@example.com") - @user_with_secondary_email.save - visit "/admin/users/#{@user_with_secondary_email.username}" - end - - step 'I see the secondary email' do - page.should have_content "Secondary email: #{@user_with_secondary_email.emails.last.email}" - end - - step 'I click remove secondary email' do - find("#remove_email_#{@user_with_secondary_email.emails.last.id}").click - end - - step 'I should not see secondary email anymore' do - page.should_not have_content "Secondary email:" - end - - step 'user "Mike" with groups and projects' do - user = create(:user, name: 'Mike') - - project = create(:empty_project) - project.team << [user, :developer] - - group = create(:group) - group.add_user(user, Gitlab::Access::DEVELOPER) - end - - step 'click on "Mike" link' do - click_link "Mike" - end - - step 'I should see user "Mike" details' do - page.should have_content 'Account' - page.should have_content 'Personal projects limit' - end - - step 'user "Pete" with ssh keys' do - user = create(:user, name: 'Pete') - create(:key, user: user, title: "ssh-rsa Key1", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4FIEBXGi4bPU8kzxMefudPIJ08/gNprdNTaO9BR/ndy3+58s2HCTw2xCHcsuBmq+TsAqgEidVq4skpqoTMB+Uot5Uzp9z4764rc48dZiI661izoREoKnuRQSsRqUTHg5wrLzwxlQbl1MVfRWQpqiz/5KjBC7yLEb9AbusjnWBk8wvC1bQPQ1uLAauEA7d836tgaIsym9BrLsMVnR4P1boWD3Xp1B1T/ImJwAGHvRmP/ycIqmKdSpMdJXwxcb40efWVj0Ibbe7ii9eeoLdHACqevUZi6fwfbymdow+FeqlkPoHyGg3Cu4vD/D8+8cRc7mE/zGCWcQ15Var83Tczour Key1") - create(:key, user: user, title: "ssh-rsa Key2", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQSTWXhJAX/He+nG78MiRRRn7m0Pb0XbcgTxE0etArgoFoh9WtvDf36HG6tOSg/0UUNcp0dICsNAmhBKdncp6cIyPaXJTURPRAGvhI0/VDk4bi27bRnccGbJ/hDaUxZMLhhrzY0r22mjVf8PF6dvv5QUIQVm1/LeaWYsHHvLgiIjwrXirUZPnFrZw6VLREoBKG8uWvfSXw1L5eapmstqfsME8099oi+vWLR8MgEysZQmD28M73fgW4zek6LDQzKQyJx9nB+hJkKUDvcuziZjGmRFlNgSA2mguERwL1OXonD8WYUrBDGKroIvBT39zS5d9tQDnidEJZ9Y8gv5ViYP7x Key2") - end - - step 'click on user "Pete"' do - click_link 'Pete' - end - - step 'I should see key list' do - page.should have_content 'ssh-rsa Key2' - page.should have_content 'ssh-rsa Key1' - end - - step 'I click on the key title' do - click_link 'ssh-rsa Key2' - end - - step 'I should see key details' do - page.should have_content 'ssh-rsa Key2' - page.should have_content 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQSTWXhJAX/He+nG78MiRRRn7m0Pb0XbcgTxE0etArgoFoh9WtvDf36HG6tOSg/0UUNcp0dICsNAmhBKdncp6cIyPaXJTURPRAGvhI0/VDk4bi27bRnccGbJ/hDaUxZMLhhrzY0r22mjVf8PF6dvv5QUIQVm1/LeaWYsHHvLgiIjwrXirUZPnFrZw6VLREoBKG8uWvfSXw1L5eapmstqfsME8099oi+vWLR8MgEysZQmD28M73fgW4zek6LDQzKQyJx9nB+hJkKUDvcuziZjGmRFlNgSA2mguERwL1OXonD8WYUrBDGKroIvBT39zS5d9tQDnidEJZ9Y8gv5ViYP7x Key2' - end - - step 'I click on remove key' do - click_link 'Remove' - end - - step 'I should see the key removed' do - page.should_not have_content 'ssh-rsa Key2' - end -end diff --git a/features/steps/dashboard/active_tab.rb b/features/steps/dashboard/active_tab.rb deleted file mode 100644 index 0e2c04fb299..00000000000 --- a/features/steps/dashboard/active_tab.rb +++ /dev/null @@ -1,9 +0,0 @@ -class Spinach::Features::DashboardActiveTab < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedActiveTab - - step 'the active main tab should be Help' do - ensure_active_main_tab('Help') - end -end diff --git a/features/steps/dashboard/archived_projects.rb b/features/steps/dashboard/archived_projects.rb deleted file mode 100644 index 969baf92287..00000000000 --- a/features/steps/dashboard/archived_projects.rb +++ /dev/null @@ -1,22 +0,0 @@ -class Spinach::Features::DashboardArchivedProjects < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - When 'project "Forum" is archived' do - project = Project.find_by(name: "Forum") - project.update_attribute(:archived, true) - end - - step 'I should see "Shop" project link' do - page.should have_link "Shop" - end - - step 'I should not see "Forum" project link' do - page.should_not have_link "Forum" - end - - step 'I should see "Forum" project link' do - page.should have_link "Forum" - end -end diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb deleted file mode 100644 index 8508b2a8096..00000000000 --- a/features/steps/dashboard/dashboard.rb +++ /dev/null @@ -1,85 +0,0 @@ -class Spinach::Features::Dashboard < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I should see "New Project" link' do - page.should have_link "New project" - end - - step 'I should see "Shop" project link' do - page.should have_link "Shop" - end - - step 'I should see last push widget' do - page.should have_content "You pushed to fix" - page.should have_link "Create Merge Request" - end - - step 'I click "Create Merge Request" link' do - click_link "Create Merge Request" - end - - step 'I see prefilled new Merge Request page' do - current_path.should == new_namespace_project_merge_request_path(@project.namespace, @project) - find("#merge_request_target_project_id").value.should == @project.id.to_s - find("#merge_request_source_branch").value.should == "fix" - find("#merge_request_target_branch").value.should == "master" - end - - step 'user with name "John Doe" joined project "Shop"' do - user = create(:user, {name: "John Doe"}) - project.team << [user, :master] - Event.create( - project: project, - author_id: user.id, - action: Event::JOINED - ) - end - - step 'I should see "John Doe joined project Shop" event' do - page.should have_content "John Doe joined project #{project.name_with_namespace}" - end - - step 'user with name "John Doe" left project "Shop"' do - user = User.find_by(name: "John Doe") - Event.create( - project: project, - author_id: user.id, - action: Event::LEFT - ) - end - - step 'I should see "John Doe left project Shop" event' do - page.should have_content "John Doe left project #{project.name_with_namespace}" - end - - step 'I have group with projects' do - @group = create(:group) - @project = create(:project, namespace: @group) - @event = create(:closed_issue_event, project: @project) - - @project.team << [current_user, :master] - end - - step 'I should see projects list' do - @user.authorized_projects.all.each do |project| - page.should have_link project.name_with_namespace - end - end - - step 'I should see groups list' do - Group.all.each do |group| - page.should have_link group.name - end - end - - step 'group has a projects that does not belongs to me' do - @forbidden_project1 = create(:project, group: @group) - @forbidden_project2 = create(:project, group: @group) - end - - step 'I should see 1 project at group list' do - find('span.last_activity/span').should have_content('1') - end -end diff --git a/features/steps/dashboard/event_filters.rb b/features/steps/dashboard/event_filters.rb deleted file mode 100644 index 3da3d62d0c0..00000000000 --- a/features/steps/dashboard/event_filters.rb +++ /dev/null @@ -1,85 +0,0 @@ -class Spinach::Features::EventFilters < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I should see push event' do - page.should have_selector('span.pushed') - end - - step 'I should not see push event' do - page.should_not have_selector('span.pushed') - end - - step 'I should see new member event' do - page.should have_selector('span.joined') - end - - step 'I should not see new member event' do - page.should_not have_selector('span.joined') - end - - step 'I should see merge request event' do - page.should have_selector('span.accepted') - end - - step 'I should not see merge request event' do - page.should_not have_selector('span.accepted') - end - - step 'this project has push event' do - data = { - before: Gitlab::Git::BLANK_SHA, - after: "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e", - ref: "refs/heads/new_design", - user_id: @user.id, - user_name: @user.name, - repository: { - name: @project.name, - url: "localhost/rubinius", - description: "", - homepage: "localhost/rubinius", - private: true - } - } - - @event = Event.create( - project: @project, - action: Event::PUSHED, - data: data, - author_id: @user.id - ) - end - - step 'this project has new member event' do - user = create(:user, {name: "John Doe"}) - Event.create( - project: @project, - author_id: user.id, - action: Event::JOINED - ) - end - - step 'this project has merge request event' do - merge_request = create :merge_request, author: @user, source_project: @project, target_project: @project - Event.create( - project: @project, - action: Event::MERGED, - target_id: merge_request.id, - target_type: "MergeRequest", - author_id: @user.id - ) - end - - When 'I click "push" event filter' do - click_link("push_event_filter") - end - - When 'I click "team" event filter' do - click_link("team_event_filter") - end - - When 'I click "merge" event filter' do - click_link("merged_event_filter") - end -end diff --git a/features/steps/dashboard/group.rb b/features/steps/dashboard/group.rb deleted file mode 100644 index 8384df2fb59..00000000000 --- a/features/steps/dashboard/group.rb +++ /dev/null @@ -1,63 +0,0 @@ -class Spinach::Features::DashboardGroup < Spinach::FeatureSteps - include SharedAuthentication - include SharedGroup - include SharedPaths - include SharedUser - - # Leave - - step 'I click on the "Leave" button for group "Owned"' do - find(:css, 'li', text: "Owner").find(:css, 'i.fa.fa-sign-out').click - # poltergeist always confirms popups. - end - - step 'I click on the "Leave" button for group "Guest"' do - find(:css, 'li', text: "Guest").find(:css, 'i.fa.fa-sign-out').click - # poltergeist always confirms popups. - end - - step 'I should not see the "Leave" button for group "Owned"' do - find(:css, 'li', text: "Owner").should_not have_selector(:css, 'i.fa.fa-sign-out') - # poltergeist always confirms popups. - end - - step 'I should not see the "Leave" button for groupr "Guest"' do - find(:css, 'li', text: "Guest").should_not have_selector(:css, 'i.fa.fa-sign-out') - # poltergeist always confirms popups. - end - - step 'I should see group "Owned" in group list' do - page.should have_content("Owned") - end - - step 'I should not see group "Owned" in group list' do - page.should_not have_content("Owned") - end - - step 'I should see group "Guest" in group list' do - page.should have_content("Guest") - end - - step 'I should not see group "Guest" in group list' do - page.should_not have_content("Guest") - end - - step 'I click new group link' do - click_link "New Group" - end - - step 'submit form with new group "Samurai" info' do - fill_in 'group_path', with: 'Samurai' - fill_in 'group_description', with: 'Tokugawa Shogunate' - click_button "Create group" - end - - step 'I should be redirected to group "Samurai" page' do - current_path.should == group_path(Group.find_by(name: 'Samurai')) - end - - step 'I should see newly created group "Samurai"' do - page.should have_content "Samurai" - page.should have_content "Tokugawa Shogunate" - end -end diff --git a/features/steps/dashboard/issues.rb b/features/steps/dashboard/issues.rb deleted file mode 100644 index 60da36e86de..00000000000 --- a/features/steps/dashboard/issues.rb +++ /dev/null @@ -1,83 +0,0 @@ -class Spinach::Features::DashboardIssues < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include Select2Helper - - step 'I should see issues assigned to me' do - should_see(assigned_issue) - should_not_see(authored_issue) - should_not_see(other_issue) - end - - step 'I should see issues authored by me' do - should_see(authored_issue) - should_see(authored_issue_on_public_project) - should_not_see(assigned_issue) - should_not_see(other_issue) - end - - step 'I should see all issues' do - should_see(authored_issue) - should_see(assigned_issue) - should_see(other_issue) - end - - step 'I have authored issues' do - authored_issue - authored_issue_on_public_project - end - - step 'I have assigned issues' do - assigned_issue - end - - step 'I have other issues' do - other_issue - end - - step 'I click "Authored by me" link' do - select2(current_user.id, from: "#author_id") - select2(nil, from: "#assignee_id") - end - - step 'I click "All" link' do - select2(nil, from: "#author_id") - select2(nil, from: "#assignee_id") - end - - def should_see(issue) - page.should have_content(issue.title[0..10]) - end - - def should_not_see(issue) - page.should_not have_content(issue.title[0..10]) - end - - def assigned_issue - @assigned_issue ||= create :issue, assignee: current_user, project: project - end - - def authored_issue - @authored_issue ||= create :issue, author: current_user, project: project - end - - def other_issue - @other_issue ||= create :issue, project: project - end - - def authored_issue_on_public_project - @authored_issue_on_public_project ||= create :issue, author: current_user, project: public_project - end - - def project - @project ||= begin - project =create :project - project.team << [current_user, :master] - project - end - end - - def public_project - @public_project ||= create :project, :public - end -end diff --git a/features/steps/dashboard/merge_requests.rb b/features/steps/dashboard/merge_requests.rb deleted file mode 100644 index 9d92082bb83..00000000000 --- a/features/steps/dashboard/merge_requests.rb +++ /dev/null @@ -1,113 +0,0 @@ -class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include Select2Helper - - step 'I should see merge requests assigned to me' do - should_see(assigned_merge_request) - should_see(assigned_merge_request_from_fork) - should_not_see(authored_merge_request) - should_not_see(authored_merge_request_from_fork) - should_not_see(other_merge_request) - end - - step 'I should see merge requests authored by me' do - should_see(authored_merge_request) - should_see(authored_merge_request_from_fork) - should_not_see(assigned_merge_request) - should_not_see(assigned_merge_request_from_fork) - should_not_see(other_merge_request) - end - - step 'I should see all merge requests' do - should_see(authored_merge_request) - should_see(assigned_merge_request) - should_see(other_merge_request) - end - - step 'I have authored merge requests' do - authored_merge_request - authored_merge_request_from_fork - end - - step 'I have assigned merge requests' do - assigned_merge_request - assigned_merge_request_from_fork - end - - step 'I have other merge requests' do - other_merge_request - end - - step 'I click "Authored by me" link' do - select2(current_user.id, from: "#author_id") - select2(nil, from: "#assignee_id") - end - - step 'I click "All" link' do - select2(nil, from: "#author_id") - select2(nil, from: "#assignee_id") - end - - def should_see(merge_request) - page.should have_content(merge_request.title[0..10]) - end - - def should_not_see(merge_request) - page.should_not have_content(merge_request.title[0..10]) - end - - def assigned_merge_request - @assigned_merge_request ||= create :merge_request, - assignee: current_user, - target_project: project, - source_project: project - end - - def authored_merge_request - @authored_merge_request ||= create :merge_request, - source_branch: 'simple_merge_request', - author: current_user, - target_project: project, - source_project: project - end - - def other_merge_request - @other_merge_request ||= create :merge_request, - source_branch: '2_3_notes_fix', - target_project: project, - source_project: project - end - - def authored_merge_request_from_fork - @authored_merge_request_from_fork ||= create :merge_request, - source_branch: 'basic_page', - author: current_user, - target_project: public_project, - source_project: forked_project - end - - def assigned_merge_request_from_fork - @assigned_merge_request_from_fork ||= create :merge_request, - source_branch: 'basic_page_fix', - assignee: current_user, - target_project: public_project, - source_project: forked_project - end - - def project - @project ||= begin - project =create :project - project.team << [current_user, :master] - project - end - end - - def public_project - @public_project ||= create :project, :public - end - - def forked_project - @forked_project ||= Projects::ForkService.new(public_project, current_user).execute - end -end diff --git a/features/steps/dashboard/new_project.rb b/features/steps/dashboard/new_project.rb deleted file mode 100644 index 5e588ceb780..00000000000 --- a/features/steps/dashboard/new_project.rb +++ /dev/null @@ -1,27 +0,0 @@ -class Spinach::Features::NewProject < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I click "New project" link' do - click_link "New project" - end - - step 'I see "New project" page' do - page.should have_content("Project path") - end - - step 'I click on "Import project from GitHub"' do - first('.how_to_import_link').click - end - - step 'I see instructions on how to import from GitHub' do - github_modal = first('.modal-body') - github_modal.should be_visible - github_modal.should have_content "To enable importing projects from GitHub" - - all('.modal-body').each do |element| - element.should_not be_visible unless element == github_modal - end - end -end diff --git a/features/steps/dashboard/shortcuts.rb b/features/steps/dashboard/shortcuts.rb deleted file mode 100644 index a9083850b52..00000000000 --- a/features/steps/dashboard/shortcuts.rb +++ /dev/null @@ -1,6 +0,0 @@ -class Spinach::Features::DashboardShortcuts < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - include SharedActiveTab -end diff --git a/features/steps/dashboard/starred_projects.rb b/features/steps/dashboard/starred_projects.rb deleted file mode 100644 index b9ad2f13e29..00000000000 --- a/features/steps/dashboard/starred_projects.rb +++ /dev/null @@ -1,15 +0,0 @@ -class Spinach::Features::DashboardStarredProjects < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I starred project "Community"' do - current_user.toggle_star(Project.find_by(name: 'Community')) - end - - step 'I should not see project "Shop"' do - within 'aside' do - page.should_not have_content('Shop') - end - end -end diff --git a/features/steps/explore/groups.rb b/features/steps/explore/groups.rb deleted file mode 100644 index 0c2127d4c4b..00000000000 --- a/features/steps/explore/groups.rb +++ /dev/null @@ -1,92 +0,0 @@ -class Spinach::Features::ExploreGroups < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedGroup - include SharedProject - - step 'group "TestGroup" has private project "Enterprise"' do - group_has_project("TestGroup", "Enterprise", Gitlab::VisibilityLevel::PRIVATE) - end - - step 'group "TestGroup" has internal project "Internal"' do - group_has_project("TestGroup", "Internal", Gitlab::VisibilityLevel::INTERNAL) - end - - step 'group "TestGroup" has public project "Community"' do - group_has_project("TestGroup", "Community", Gitlab::VisibilityLevel::PUBLIC) - end - - step '"John Doe" is owner of group "TestGroup"' do - group = Group.find_by(name: "TestGroup") || create(:group, name: "TestGroup") - user = create(:user, name: "John Doe") - group.add_user(user, Gitlab::Access::OWNER) - end - - step 'I visit group "TestGroup" page' do - visit group_path(Group.find_by(name: "TestGroup")) - end - - step 'I visit group "TestGroup" issues page' do - visit issues_group_path(Group.find_by(name: "TestGroup")) - end - - step 'I visit group "TestGroup" merge requests page' do - visit merge_requests_group_path(Group.find_by(name: "TestGroup")) - end - - step 'I visit group "TestGroup" members page' do - visit group_group_members_path(Group.find_by(name: "TestGroup")) - end - - step 'I should not see project "Enterprise" items' do - page.should_not have_content "Enterprise" - end - - step 'I should see project "Internal" items' do - page.should have_content "Internal" - end - - step 'I should not see project "Internal" items' do - page.should_not have_content "Internal" - end - - step 'I should see project "Community" items' do - page.should have_content "Community" - end - - step 'I change filter to Everyone\'s' do - click_link "Everyone's" - end - - step 'I should see group member "John Doe"' do - page.should have_content "John Doe" - end - - step 'I should not see member roles' do - body.should_not match(%r{owner|developer|reporter|guest}i) - end - - protected - - def group_has_project(groupname, projectname, visibility_level) - group = Group.find_by(name: groupname) || create(:group, name: groupname) - project = create(:project, - namespace: group, - name: projectname, - path: "#{groupname}-#{projectname}", - visibility_level: visibility_level - ) - create(:issue, - title: "#{projectname} feature", - project: project - ) - create(:merge_request, - title: "#{projectname} feature implemented", - source_project: project, - target_project: project - ) - create(:closed_issue_event, - project: project - ) - end -end diff --git a/features/steps/explore/projects.rb b/features/steps/explore/projects.rb deleted file mode 100644 index 26b71406bd8..00000000000 --- a/features/steps/explore/projects.rb +++ /dev/null @@ -1,148 +0,0 @@ -class Spinach::Features::ExploreProjects < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I should see project "Empty Public Project"' do - page.should have_content "Empty Public Project" - end - - step 'I should see public project details' do - page.should have_content '32 branches' - page.should have_content '16 tags' - end - - step 'I should see project readme' do - page.should have_content 'README.md' - end - - step 'I should see empty public project details' do - page.should have_content 'Git global setup' - end - - step 'I should see empty public project details with http clone info' do - project = Project.find_by(name: 'Empty Public Project') - all(:css, '.git-empty .clone').each do |element| - element.text.should include(project.http_url_to_repo) - end - end - - step 'I should see empty public project details with ssh clone info' do - project = Project.find_by(name: 'Empty Public Project') - all(:css, '.git-empty .clone').each do |element| - element.text.should include(project.url_to_repo) - end - end - - step 'I should see project "Community" home page' do - within '.navbar-gitlab .title' do - page.should have_content 'Community' - end - end - - step 'I should see project "Internal" home page' do - within '.navbar-gitlab .title' do - page.should have_content 'Internal' - end - end - - step 'I should see an http link to the repository' do - project = Project.find_by(name: 'Community') - page.should have_field('project_clone', with: project.http_url_to_repo) - end - - step 'I should see an ssh link to the repository' do - project = Project.find_by(name: 'Community') - page.should have_field('project_clone', with: project.url_to_repo) - end - - step 'I visit "Community" issues page' do - create(:issue, - title: "Bug", - project: public_project - ) - create(:issue, - title: "New feature", - project: public_project - ) - visit namespace_project_issues_path(public_project.namespace, public_project) - end - - - step 'I should see list of issues for "Community" project' do - page.should have_content "Bug" - page.should have_content public_project.name - page.should have_content "New feature" - end - - step 'I visit "Internal" issues page' do - create(:issue, - title: "Internal Bug", - project: internal_project - ) - create(:issue, - title: "New internal feature", - project: internal_project - ) - visit namespace_project_issues_path(internal_project.namespace, internal_project) - end - - - step 'I should see list of issues for "Internal" project' do - page.should have_content "Internal Bug" - page.should have_content internal_project.name - page.should have_content "New internal feature" - end - - step 'I visit "Community" merge requests page' do - visit namespace_project_merge_requests_path(public_project.namespace, public_project) - end - - step 'project "Community" has "Bug fix" open merge request' do - create(:merge_request, - title: "Bug fix for public project", - source_project: public_project, - target_project: public_project, - ) - end - - step 'I should see list of merge requests for "Community" project' do - page.should have_content public_project.name - page.should have_content public_merge_request.source_project.name - end - - step 'I visit "Internal" merge requests page' do - visit namespace_project_merge_requests_path(internal_project.namespace, internal_project) - end - - step 'project "Internal" has "Feature implemented" open merge request' do - create(:merge_request, - title: "Feature implemented", - source_project: internal_project, - target_project: internal_project - ) - end - - step 'I should see list of merge requests for "Internal" project' do - page.should have_content internal_project.name - page.should have_content internal_merge_request.source_project.name - end - - def internal_project - @internal_project ||= Project.find_by!(name: 'Internal') - end - - def public_project - @public_project ||= Project.find_by!(name: 'Community') - end - - - def internal_merge_request - @internal_merge_request ||= MergeRequest.find_by!(title: 'Feature implemented') - end - - def public_merge_request - @public_merge_request ||= MergeRequest.find_by!(title: 'Bug fix for public project') - end -end - diff --git a/features/steps/groups.rb b/features/steps/groups.rb deleted file mode 100644 index 228b83e5fd0..00000000000 --- a/features/steps/groups.rb +++ /dev/null @@ -1,300 +0,0 @@ -class Spinach::Features::Groups < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedGroup - include SharedUser - include Select2Helper - - step 'gitlab user "Mike"' do - create(:user, name: "Mike") - end - - step 'I click link "Add members"' do - find(:css, 'button.btn-new').click - end - - step 'I select "Mike" as "Reporter"' do - user = User.find_by(name: "Mike") - - within ".users-group-form" do - select2(user.id, from: "#user_ids", multiple: true) - select "Reporter", from: "access_level" - end - - click_button "Add users to group" - end - - step 'I should see "Mike" in team list as "Reporter"' do - within '.well-list' do - page.should have_content('Mike') - page.should have_content('Reporter') - end - end - - step 'I select "sjobs@apple.com" as "Reporter"' do - within ".users-group-form" do - select2("sjobs@apple.com", from: "#user_ids", multiple: true) - select "Reporter", from: "access_level" - end - - click_button "Add users to group" - end - - step 'I should see "sjobs@apple.com" in team list as invited "Reporter"' do - within '.well-list' do - page.should have_content('sjobs@apple.com') - page.should have_content('invited') - page.should have_content('Reporter') - end - end - - step 'I should see group "Owned" projects list' do - Group.find_by(name: "Owned").projects.each do |project| - page.should have_link project.name - end - end - - step 'I should see projects activity feed' do - page.should have_content 'closed issue' - end - - step 'I should see issues from group "Owned" assigned to me' do - assigned_to_me(:issues).each do |issue| - page.should have_content issue.title - end - end - - step 'I should see merge requests from group "Owned" assigned to me' do - assigned_to_me(:merge_requests).each do |issue| - page.should have_content issue.title[0..80] - end - end - - step 'I select user "Mary Jane" from list with role "Reporter"' do - user = User.find_by(name: "Mary Jane") || create(:user, name: "Mary Jane") - click_button 'Add members' - within ".users-group-form" do - select2(user.id, from: "#user_ids", multiple: true) - select "Reporter", from: "access_level" - end - click_button "Add users to group" - end - - step 'I should see user "John Doe" in team list' do - projects_with_access = find(".panel .well-list") - projects_with_access.should have_content("John Doe") - end - - step 'I should not see user "John Doe" in team list' do - projects_with_access = find(".panel .well-list") - projects_with_access.should_not have_content("John Doe") - end - - step 'I should see user "Mary Jane" in team list' do - projects_with_access = find(".panel .well-list") - projects_with_access.should have_content("Mary Jane") - end - - step 'I should not see user "Mary Jane" in team list' do - projects_with_access = find(".panel .well-list") - projects_with_access.should_not have_content("Mary Jane") - end - - step 'project from group "Owned" has issues assigned to me' do - create :issue, - project: project, - assignee: current_user, - author: current_user - end - - step 'project from group "Owned" has merge requests assigned to me' do - create :merge_request, - source_project: project, - target_project: project, - assignee: current_user, - author: current_user - end - - step 'I change group "Owned" name to "new-name"' do - fill_in 'group_name', with: 'new-name' - fill_in 'group_path', with: 'new-name' - click_button "Save group" - end - - step 'I should see new group "Owned" name' do - within ".navbar-gitlab" do - page.should have_content "new-name" - end - end - - step 'I change group "Owned" avatar' do - attach_file(:group_avatar, File.join(Rails.root, 'public', 'gitlab_logo.png')) - click_button "Save group" - Group.find_by(name: "Owned").reload - end - - step 'I should see new group "Owned" avatar' do - Group.find_by(name: "Owned").avatar.should be_instance_of AvatarUploader - Group.find_by(name: "Owned").avatar.url.should == "/uploads/group/avatar/#{ Group.find_by(name:"Owned").id }/gitlab_logo.png" - end - - step 'I should see the "Remove avatar" button' do - page.should have_link("Remove avatar") - end - - step 'I have group "Owned" avatar' do - attach_file(:group_avatar, File.join(Rails.root, 'public', 'gitlab_logo.png')) - click_button "Save group" - Group.find_by(name: "Owned").reload - end - - step 'I remove group "Owned" avatar' do - click_link "Remove avatar" - Group.find_by(name: "Owned").reload - end - - step 'I should not see group "Owned" avatar' do - Group.find_by(name: "Owned").avatar?.should be_false - end - - step 'I should not see the "Remove avatar" button' do - page.should_not have_link("Remove avatar") - end - - step 'I click on the "Remove User From Group" button for "John Doe"' do - find(:css, 'li', text: "John Doe").find(:css, 'a.btn-remove').click - # poltergeist always confirms popups. - end - - step 'I click on the "Remove User From Group" button for "Mary Jane"' do - find(:css, 'li', text: "Mary Jane").find(:css, 'a.btn-remove').click - # poltergeist always confirms popups. - end - - step 'I should not see the "Remove User From Group" button for "John Doe"' do - find(:css, 'li', text: "John Doe").should_not have_selector(:css, 'a.btn-remove') - # poltergeist always confirms popups. - end - - step 'I should not see the "Remove User From Group" button for "Mary Jane"' do - find(:css, 'li', text: "Mary Jane").should_not have_selector(:css, 'a.btn-remove') - # poltergeist always confirms popups. - end - - step 'I search for \'Mary\' member' do - within '.member-search-form' do - fill_in 'search', with: 'Mary' - click_button 'Search' - end - end - - step 'I click on group milestones' do - click_link 'Milestones' - end - - step 'I should see group milestones index page has no milestones' do - page.should have_content('No milestones to show') - end - - step 'Group has projects with milestones' do - group_milestone - end - - step 'I should see group milestones index page with milestones' do - page.should have_content('Version 7.2') - page.should have_content('GL-113') - page.should have_link('2 Issues', href: group_milestone_path("owned", "version-7-2", title: "Version 7.2")) - page.should have_link('3 Merge Requests', href: group_milestone_path("owned", "gl-113", title: "GL-113")) - end - - step 'I click on one group milestone' do - click_link 'GL-113' - end - - step 'I should see group milestone with descriptions and expiry date' do - page.should have_content('expires at Aug 20, 2114') - end - - step 'I should see group milestone with all issues and MRs assigned to that milestone' do - page.should have_content('Milestone GL-113') - page.should have_content('Progress: 0 closed – 4 open') - page.should have_link(@issue1.title, href: namespace_project_issue_path(@project1.namespace, @project1, @issue1)) - page.should have_link(@mr3.title, href: namespace_project_merge_request_path(@project3.namespace, @project3, @mr3)) - end - - protected - - def assigned_to_me(key) - project.send(key).where(assignee_id: current_user.id) - end - - def project - Group.find_by(name: "Owned").projects.first - end - - def group_milestone - group = Group.find_by(name: "Owned") - - @project1 = create :project, - group: group - project2 = create :project, - path: 'gitlab-ci', - group: group - @project3 = create :project, - path: 'cookbook-gitlab', - group: group - milestone1_project1 = create :milestone, - title: "Version 7.2", - project: @project1 - milestone1_project2 = create :milestone, - title: "Version 7.2", - project: project2 - milestone1_project3 = create :milestone, - title: "Version 7.2", - project: @project3 - milestone2_project1 = create :milestone, - title: "GL-113", - project: @project1 - milestone2_project2 = create :milestone, - title: "GL-113", - project: project2 - milestone2_project3 = create :milestone, - title: "GL-113", - project: @project3, - due_date: '2114-08-20', - description: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry' - @issue1 = create :issue, - project: @project1, - assignee: current_user, - author: current_user, - milestone: milestone2_project1 - issue2 = create :issue, - project: project2, - assignee: current_user, - author: current_user, - milestone: milestone1_project2 - issue3 = create :issue, - project: @project3, - assignee: current_user, - author: current_user, - milestone: milestone1_project1 - mr1 = create :merge_request, - source_project: @project1, - target_project: @project1, - assignee: current_user, - author: current_user, - milestone: milestone2_project1 - mr2 = create :merge_request, - source_project: project2, - target_project: project2, - assignee: current_user, - author: current_user, - milestone: milestone2_project2 - @mr3 = create :merge_request, - source_project: @project3, - target_project: @project3, - assignee: current_user, - author: current_user, - milestone: milestone2_project3 - end -end diff --git a/features/steps/invites.rb b/features/steps/invites.rb deleted file mode 100644 index d051cc3edc8..00000000000 --- a/features/steps/invites.rb +++ /dev/null @@ -1,80 +0,0 @@ -class Spinach::Features::Invites < Spinach::FeatureSteps - include SharedAuthentication - include SharedUser - include SharedGroup - - step '"John Doe" has invited "user@example.com" to group "Owned"' do - user = User.find_by(name: "John Doe") - group = Group.find_by(name: "Owned") - group.add_user("user@example.com", Gitlab::Access::DEVELOPER, user) - end - - step 'I visit the invitation page' do - group = Group.find_by(name: "Owned") - invite = group.group_members.invite.last - invite.generate_invite_token! - @raw_invite_token = invite.raw_invite_token - visit invite_path(@raw_invite_token) - end - - step 'I should be redirected to the sign in page' do - expect(current_path).to eq(new_user_session_path) - end - - step 'I should see a notice telling me to sign in' do - expect(page).to have_content "To accept this invitation, sign in" - end - - step 'I should be redirected to the invitation page' do - expect(current_path).to eq(invite_path(@raw_invite_token)) - end - - step 'I should see the invitation details' do - expect(page).to have_content("You have been invited by John Doe to join group Owned as Developer.") - end - - step "I should see a message telling me I'm already a member" do - expect(page).to have_content("However, you are already a member of this group.") - end - - step 'I should see an "Accept invitation" button' do - expect(page).to have_link("Accept invitation") - end - - step 'I should see a "Decline" button' do - expect(page).to have_link("Decline") - end - - step 'I click the "Accept invitation" button' do - page.click_link "Accept invitation" - end - - step 'I should be redirected to the group page' do - group = Group.find_by(name: "Owned") - expect(current_path).to eq(group_path(group)) - end - - step 'I should see a notice telling me I have access' do - expect(page).to have_content("You have been granted Developer access to group Owned.") - end - - step 'I click the "Decline" button' do - page.click_link "Decline" - end - - step 'I should be redirected to the dashboard' do - expect(current_path).to eq(dashboard_path) - end - - step 'I should see a notice telling me I have declined' do - expect(page).to have_content("You have declined the invitation to join group Owned.") - end - - step "I visit the invitation's decline page" do - group = Group.find_by(name: "Owned") - invite = group.group_members.invite.last - invite.generate_invite_token! - @raw_invite_token = invite.raw_invite_token - visit decline_invite_path(@raw_invite_token) - end -end diff --git a/features/steps/profile/active_tab.rb b/features/steps/profile/active_tab.rb deleted file mode 100644 index 8595ee876a4..00000000000 --- a/features/steps/profile/active_tab.rb +++ /dev/null @@ -1,25 +0,0 @@ -class Spinach::Features::ProfileActiveTab < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedActiveTab - - step 'the active main tab should be Home' do - ensure_active_main_tab('Profile') - end - - step 'the active main tab should be Account' do - ensure_active_main_tab('Account') - end - - step 'the active main tab should be SSH Keys' do - ensure_active_main_tab('SSH Keys') - end - - step 'the active main tab should be Design' do - ensure_active_main_tab('Design') - end - - step 'the active main tab should be History' do - ensure_active_main_tab('History') - end -end diff --git a/features/steps/profile/emails.rb b/features/steps/profile/emails.rb deleted file mode 100644 index 2b6ac37d866..00000000000 --- a/features/steps/profile/emails.rb +++ /dev/null @@ -1,48 +0,0 @@ -class Spinach::Features::ProfileEmails < Spinach::FeatureSteps - include SharedAuthentication - - step 'I visit profile emails page' do - visit profile_emails_path - end - - step 'I should see my emails' do - page.should have_content(@user.email) - @user.emails.each do |email| - page.should have_content(email.email) - end - end - - step 'I submit new email "my@email.com"' do - fill_in "email_email", with: "my@email.com" - click_button "Add" - end - - step 'I should see new email "my@email.com"' do - email = @user.emails.find_by(email: "my@email.com") - email.should_not be_nil - page.should have_content("my@email.com") - end - - step 'I should not see email "my@email.com"' do - email = @user.emails.find_by(email: "my@email.com") - email.should be_nil - page.should_not have_content("my@email.com") - end - - step 'I click link "Remove" for "my@email.com"' do - # there should only be one remove button at this time - click_link "Remove" - # force these to reload as they have been cached - @user.emails.reload - end - - step 'I submit duplicate email @user.email' do - fill_in "email_email", with: @user.email - click_button "Add" - end - - step 'I should not have @user.email added' do - email = @user.emails.find_by(email: @user.email) - email.should be_nil - end -end diff --git a/features/steps/profile/notifications.rb b/features/steps/profile/notifications.rb deleted file mode 100644 index 13e93618eb7..00000000000 --- a/features/steps/profile/notifications.rb +++ /dev/null @@ -1,12 +0,0 @@ -class Spinach::Features::ProfileNotifications < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - - step 'I visit profile notifications page' do - visit profile_notifications_path - end - - step 'I should see global notifications settings' do - page.should have_content "Notifications Settings" - end -end diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb deleted file mode 100644 index 791982d16c3..00000000000 --- a/features/steps/profile/profile.rb +++ /dev/null @@ -1,242 +0,0 @@ -class Spinach::Features::Profile < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - - step 'I should see my profile info' do - page.should have_content "Profile Settings" - end - - step 'I change my profile info' do - fill_in "user_skype", with: "testskype" - fill_in "user_linkedin", with: "testlinkedin" - fill_in "user_twitter", with: "testtwitter" - fill_in "user_website_url", with: "testurl" - fill_in "user_location", with: "Ukraine" - click_button "Save changes" - @user.reload - end - - step 'I should see new profile info' do - @user.skype.should == 'testskype' - @user.linkedin.should == 'testlinkedin' - @user.twitter.should == 'testtwitter' - @user.website_url.should == 'testurl' - find("#user_location").value.should == "Ukraine" - end - - step 'I change my avatar' do - attach_file(:user_avatar, File.join(Rails.root, 'public', 'gitlab_logo.png')) - click_button "Save changes" - @user.reload - end - - step 'I should see new avatar' do - @user.avatar.should be_instance_of AvatarUploader - @user.avatar.url.should == "/uploads/user/avatar/#{ @user.id }/gitlab_logo.png" - end - - step 'I should see the "Remove avatar" button' do - page.should have_link("Remove avatar") - end - - step 'I have an avatar' do - attach_file(:user_avatar, File.join(Rails.root, 'public', 'gitlab_logo.png')) - click_button "Save changes" - @user.reload - end - - step 'I remove my avatar' do - click_link "Remove avatar" - @user.reload - end - - step 'I should see my gravatar' do - @user.avatar?.should be_false - end - - step 'I should not see the "Remove avatar" button' do - page.should_not have_link("Remove avatar") - end - - step 'I try change my password w/o old one' do - within '.update-password' do - fill_in "user_password", with: "22233344" - fill_in "user_password_confirmation", with: "22233344" - click_button "Save" - end - end - - step 'I change my password' do - within '.update-password' do - fill_in "user_current_password", with: "12345678" - fill_in "user_password", with: "22233344" - fill_in "user_password_confirmation", with: "22233344" - click_button "Save" - end - end - - step 'I unsuccessfully change my password' do - within '.update-password' do - fill_in "user_current_password", with: "12345678" - fill_in "user_password", with: "password" - fill_in "user_password_confirmation", with: "confirmation" - click_button "Save" - end - end - - step "I should see a missing password error message" do - page.should have_content "You must provide a valid current password" - end - - step "I should see a password error message" do - page.should have_content "Password confirmation doesn't match" - end - - step 'I reset my token' do - within '.update-token' do - @old_token = @user.private_token - click_button "Reset" - end - end - - step 'I should see new token' do - find("#token").value.should_not == @old_token - find("#token").value.should == @user.reload.private_token - end - - step 'I have activity' do - create(:closed_issue_event, author: current_user) - end - - step 'I should see my activity' do - page.should have_content "#{current_user.name} closed issue" - end - - step "I change my application theme" do - within '.application-theme' do - choose "Violet" - end - end - - step "I change my code preview theme" do - within '.code-preview-theme' do - choose "Solarized dark" - end - end - - step "I should see the theme change immediately" do - page.should have_selector('body.ui_color') - page.should_not have_selector('body.ui_basic') - end - - step "I should receive feedback that the changes were saved" do - page.should have_content("saved") - end - - step 'my password is expired' do - current_user.update_attributes(password_expires_at: Time.now - 1.hour) - end - - step "I am not an ldap user" do - current_user.identities.delete - current_user.ldap_user?.should be_false - end - - step 'I redirected to expired password page' do - current_path.should == new_profile_password_path - end - - step 'I submit new password' do - fill_in :user_current_password, with: '12345678' - fill_in :user_password, with: '12345678' - fill_in :user_password_confirmation, with: '12345678' - click_button "Set new password" - end - - step 'I redirected to sign in page' do - current_path.should == new_user_session_path - end - - step 'I should be redirected to password page' do - current_path.should == edit_profile_password_path - end - - step 'I should be redirected to account page' do - current_path.should == profile_account_path - end - - step 'I click on my profile picture' do - click_link 'profile-pic' - end - - step 'I should see my user page' do - page.should have_content "User Activity" - - within '.navbar-gitlab' do - page.should have_content current_user.name - end - end - - step 'I have group with projects' do - @group = create(:group) - @group.add_owner(current_user) - @project = create(:project, namespace: @group) - @event = create(:closed_issue_event, project: @project) - - @project.team << [current_user, :master] - end - - step 'I should see groups I belong to' do - page.should have_css('.profile-groups-avatars', visible: true) - end - - step 'I click on new application button' do - click_on 'New Application' - end - - step 'I should see application form' do - page.should have_content "New application" - end - - step 'I fill application form out and submit' do - fill_in :doorkeeper_application_name, with: 'test' - fill_in :doorkeeper_application_redirect_uri, with: 'https://test.com' - click_on "Submit" - end - - step 'I see application' do - page.should have_content "Application: test" - page.should have_content "Application Id" - page.should have_content "Secret" - end - - step 'I click edit' do - click_on "Edit" - end - - step 'I see edit application form' do - page.should have_content "Edit application" - end - - step 'I change name of application and submit' do - page.should have_content "Edit application" - fill_in :doorkeeper_application_name, with: 'test_changed' - click_on "Submit" - end - - step 'I see that application was changed' do - page.should have_content "test_changed" - page.should have_content "Application Id" - page.should have_content "Secret" - end - - step 'I click to remove application' do - within '.oauth-applications' do - click_on "Destroy" - end - end - - step "I see that application is removed" do - page.find(".oauth-applications").should_not have_content "test_changed" - end -end diff --git a/features/steps/profile/ssh_keys.rb b/features/steps/profile/ssh_keys.rb deleted file mode 100644 index ea912e5b4da..00000000000 --- a/features/steps/profile/ssh_keys.rb +++ /dev/null @@ -1,46 +0,0 @@ -class Spinach::Features::ProfileSshKeys < Spinach::FeatureSteps - include SharedAuthentication - - step 'I should see my ssh keys' do - @user.keys.each do |key| - page.should have_content(key.title) - end - end - - step 'I click link "Add new"' do - click_link "Add SSH Key" - end - - step 'I submit new ssh key "Laptop"' do - fill_in "key_title", with: "Laptop" - fill_in "key_key", with: "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop" - click_button "Add key" - end - - step 'I should see new ssh key "Laptop"' do - key = Key.find_by(title: "Laptop") - page.should have_content(key.title) - page.should have_content(key.key) - current_path.should == profile_key_path(key) - end - - step 'I click link "Work"' do - click_link "Work" - end - - step 'I click link "Remove"' do - click_link "Remove" - end - - step 'I visit profile keys page' do - visit profile_keys_path - end - - step 'I should not see "Work" ssh key' do - page.should_not have_content "Work" - end - - step 'I have ssh key "ssh-rsa Work"' do - create(:key, user: @user, title: "ssh-rsa Work", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+L3TbFegm3k8QjejSwemk4HhlRh+DuN679Pc5ckqE/MPhVtE/+kZQDYCTB284GiT2aIoGzmZ8ee9TkaoejAsBwlA+Wz2Q3vhz65X6sMgalRwpdJx8kSEUYV8ZPV3MZvPo8KdNg993o4jL6G36GDW4BPIyO6FPZhfsawdf6liVD0Xo5kibIK7B9VoE178cdLQtLpS2YolRwf5yy6XR6hbbBGQR+6xrGOdP16eGZDb1CE2bMvvJijjloFqPscGktWOqW+nfh5txwFfBzlfARDTBsS8WZtg3Yoj1kn33kPsWRlgHfNutFRAIynDuDdQzQq8tTtVwm+Yi75RfcPHW8y3P Work") - end -end diff --git a/features/steps/project/active_tab.rb b/features/steps/project/active_tab.rb deleted file mode 100644 index dd3215adb1a..00000000000 --- a/features/steps/project/active_tab.rb +++ /dev/null @@ -1,103 +0,0 @@ -class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - include SharedActiveTab - include SharedProjectTab - - # Sub Tabs: Home - - step 'I click the "Team" tab' do - click_link('Members') - end - - step 'I click the "Attachments" tab' do - click_link('Attachments') - end - - step 'I click the "Snippets" tab' do - click_link('Snippets') - end - - step 'I click the "Edit" tab' do - within '.project-settings-nav' do - click_link('Project') - end - end - - step 'I click the "Hooks" tab' do - click_link('Web Hooks') - end - - step 'I click the "Deploy Keys" tab' do - click_link('Deploy Keys') - end - - step 'the active sub nav should be Team' do - ensure_active_sub_nav('Members') - end - - step 'the active sub nav should be Edit' do - ensure_active_sub_nav('Project') - end - - step 'the active sub nav should be Hooks' do - ensure_active_sub_nav('Web Hooks') - end - - step 'the active sub nav should be Deploy Keys' do - ensure_active_sub_nav('Deploy Keys') - end - - # Sub Tabs: Commits - - step 'I click the "Compare" tab' do - click_link('Compare') - end - - step 'I click the "Branches" tab' do - click_link('Branches') - end - - step 'I click the "Tags" tab' do - click_link('Tags') - end - - step 'the active sub tab should be Commits' do - ensure_active_sub_tab('Commits') - end - - step 'the active sub tab should be Compare' do - ensure_active_sub_tab('Compare') - end - - step 'the active sub tab should be Branches' do - ensure_active_sub_tab('Branches') - end - - step 'the active sub tab should be Tags' do - ensure_active_sub_tab('Tags') - end - - # Sub Tabs: Issues - - step 'I click the "Milestones" tab' do - click_link('Milestones') - end - - step 'I click the "Labels" tab' do - click_link('Labels') - end - - step 'the active sub tab should be Issues' do - ensure_active_sub_tab('Issues') - end - - step 'the active main tab should be Milestones' do - ensure_active_main_tab('Milestones') - end - - step 'the active main tab should be Labels' do - ensure_active_main_tab('Labels') - end -end diff --git a/features/steps/project/archived.rb b/features/steps/project/archived.rb deleted file mode 100644 index 37ad0c77655..00000000000 --- a/features/steps/project/archived.rb +++ /dev/null @@ -1,37 +0,0 @@ -class Spinach::Features::ProjectArchived < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - When 'project "Forum" is archived' do - project = Project.find_by(name: "Forum") - project.update_attribute(:archived, true) - end - - When 'project "Shop" is archived' do - project = Project.find_by(name: "Shop") - project.update_attribute(:archived, true) - end - - When 'I visit project "Forum" page' do - project = Project.find_by(name: "Forum") - visit namespace_project_path(project.namespace, project) - end - - step 'I should not see "Archived"' do - page.should_not have_content "Archived" - end - - step 'I should see "Archived"' do - page.should have_content "Archived" - end - - When 'I set project archived' do - click_link "Archive" - end - - When 'I set project unarchived' do - click_link "Unarchive" - end - -end diff --git a/features/steps/project/commits/branches.rb b/features/steps/project/commits/branches.rb deleted file mode 100644 index 07f7e5796a3..00000000000 --- a/features/steps/project/commits/branches.rb +++ /dev/null @@ -1,85 +0,0 @@ -class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'I click link "All"' do - click_link "All" - end - - step 'I should see "Shop" all branches list' do - page.should have_content "Branches" - page.should have_content "master" - end - - step 'I click link "Protected"' do - click_link "Protected" - end - - step 'I should see "Shop" protected branches list' do - within ".protected-branches-list" do - page.should have_content "stable" - page.should_not have_content "master" - end - end - - step 'project "Shop" has protected branches' do - project = Project.find_by(name: "Shop") - project.protected_branches.create(name: "stable") - end - - step 'I click new branch link' do - click_link "New branch" - end - - step 'I submit new branch form' do - fill_in 'branch_name', with: 'deploy_keys' - fill_in 'ref', with: 'master' - click_button 'Create branch' - end - - step 'I submit new branch form with invalid name' do - fill_in 'branch_name', with: '1.0 stable' - fill_in 'ref', with: 'master' - click_button 'Create branch' - end - - step 'I submit new branch form with invalid reference' do - fill_in 'branch_name', with: 'foo' - fill_in 'ref', with: 'foo' - click_button 'Create branch' - end - - step 'I submit new branch form with branch that already exists' do - fill_in 'branch_name', with: 'master' - fill_in 'ref', with: 'master' - click_button 'Create branch' - end - - step 'I should see new branch created' do - page.should have_content 'deploy_keys' - end - - step 'I should see new an error that branch is invalid' do - page.should have_content 'Branch name invalid' - end - - step 'I should see new an error that ref is invalid' do - page.should have_content 'Invalid reference name' - end - - step 'I should see new an error that branch already exists' do - page.should have_content 'Branch already exists' - end - - step "I click branch 'improve/awesome' delete link" do - within '.js-branch-improve\/awesome' do - find('.btn-remove').click - sleep 0.05 - end - end - - step "I should not see branch 'improve/awesome'" do - all(visible: true).should_not have_content 'improve/awesome' - end -end diff --git a/features/steps/project/commits/comments.rb b/features/steps/project/commits/comments.rb deleted file mode 100644 index 3d4d8ad6368..00000000000 --- a/features/steps/project/commits/comments.rb +++ /dev/null @@ -1,6 +0,0 @@ -class Spinach::Features::ProjectCommitsComments < Spinach::FeatureSteps - include SharedAuthentication - include SharedNote - include SharedPaths - include SharedProject -end diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb deleted file mode 100644 index 57b727f837e..00000000000 --- a/features/steps/project/commits/commits.rb +++ /dev/null @@ -1,103 +0,0 @@ -class Spinach::Features::ProjectCommits < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - include RepoHelpers - - step 'I see project commits' do - commit = @project.repository.commit - page.should have_content(@project.name) - page.should have_content(commit.message[0..20]) - page.should have_content(commit.short_id) - end - - step 'I click atom feed link' do - click_link "Feed" - end - - step 'I see commits atom feed' do - commit = @project.repository.commit - response_headers['Content-Type'].should have_content("application/atom+xml") - body.should have_selector("title", text: "Recent commits to #{@project.name}") - body.should have_selector("author email", text: commit.author_email) - body.should have_selector("entry summary", text: commit.description[0..10]) - end - - step 'I click on commit link' do - visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id) - end - - step 'I see commit info' do - page.should have_content sample_commit.message - page.should have_content "Showing #{sample_commit.files_changed_count} changed files" - end - - step 'I fill compare fields with refs' do - fill_in "from", with: sample_commit.parent_id - fill_in "to", with: sample_commit.id - click_button "Compare" - end - - step 'I unfold diff' do - @diff = first('.js-unfold') - @diff.click - sleep 2 - end - - step 'I should see additional file lines' do - within @diff.parent do - first('.new_line').text.should_not have_content "..." - end - end - - step 'I see compared refs' do - page.should have_content "Compare View" - page.should have_content "Commits (1)" - page.should have_content "Showing 2 changed files" - end - - step 'I see breadcrumb links' do - page.should have_selector('ul.breadcrumb') - page.should have_selector('ul.breadcrumb a', count: 4) - end - - step 'I see commits stats' do - page.should have_content 'Top 50 Committers' - page.should have_content 'Committers' - page.should have_content 'Total commits' - page.should have_content 'Authors' - end - - step 'I visit big commit page' do - Commit::DIFF_SAFE_FILES = 20 - visit namespace_project_commit_path(@project.namespace, @project, sample_big_commit.id) - end - - step 'I see big commit warning' do - page.should have_content sample_big_commit.message - page.should have_content "Too many changes" - Commit::DIFF_SAFE_FILES = 100 - end - - step 'I visit a commit with an image that changed' do - visit namespace_project_commit_path(@project.namespace, @project, sample_image_commit.id) - end - - step 'The diff links to both the previous and current image' do - links = all('.two-up span div a') - links[0]['href'].should =~ %r{blob/#{sample_image_commit.old_blob_id}} - links[1]['href'].should =~ %r{blob/#{sample_image_commit.new_blob_id}} - end - - step 'I click side-by-side diff button' do - click_link "Side-by-side" - end - - step 'I see side-by-side diff button' do - page.should have_content "Side-by-side" - end - - step 'I see inline diff button' do - page.should have_content "Inline" - end -end diff --git a/features/steps/project/commits/diff_comments.rb b/features/steps/project/commits/diff_comments.rb deleted file mode 100644 index b9d8cf2c5a5..00000000000 --- a/features/steps/project/commits/diff_comments.rb +++ /dev/null @@ -1,6 +0,0 @@ -class Spinach::Features::ProjectCommitsDiffComments < Spinach::FeatureSteps - include SharedAuthentication - include SharedDiffNote - include SharedPaths - include SharedProject -end diff --git a/features/steps/project/commits/tags.rb b/features/steps/project/commits/tags.rb deleted file mode 100644 index 3465fcbfd07..00000000000 --- a/features/steps/project/commits/tags.rb +++ /dev/null @@ -1,82 +0,0 @@ -class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'I should see "Shop" all tags list' do - page.should have_content "Tags" - page.should have_content "v1.0.0" - end - - step 'I click new tag link' do - click_link 'New tag' - end - - step 'I submit new tag form' do - fill_in 'tag_name', with: 'v7.0' - fill_in 'ref', with: 'master' - click_button 'Create tag' - end - - step 'I submit new tag form with invalid name' do - fill_in 'tag_name', with: 'v 1.0' - fill_in 'ref', with: 'master' - click_button 'Create tag' - end - - step 'I submit new tag form with invalid reference' do - fill_in 'tag_name', with: 'foo' - fill_in 'ref', with: 'foo' - click_button 'Create tag' - end - - step 'I submit new tag form with tag that already exists' do - fill_in 'tag_name', with: 'v1.0.0' - fill_in 'ref', with: 'master' - click_button 'Create tag' - end - - step 'I should see new tag created' do - page.should have_content 'v7.0' - end - - step 'I should see new an error that tag is invalid' do - page.should have_content 'Tag name invalid' - end - - step 'I should see new an error that tag ref is invalid' do - page.should have_content 'Invalid reference name' - end - - step 'I should see new an error that tag already exists' do - page.should have_content 'Tag already exists' - end - - step "I delete tag 'v1.1.0'" do - within '.tags' do - first('.btn-remove').click - sleep 0.05 - end - end - - step "I should not see tag 'v1.1.0'" do - within '.tags' do - all(visible: true).should_not have_content 'v1.1.0' - end - end - - step 'I delete all tags' do - within '.tags' do - all('.btn-remove').each do |remove| - remove.click - sleep 0.05 - end - end - end - - step 'I should see tags info message' do - within '.tags' do - page.should have_content 'Repository has no tags yet.' - end - end -end diff --git a/features/steps/project/commits/user_lookup.rb b/features/steps/project/commits/user_lookup.rb deleted file mode 100644 index 63ff84c82ef..00000000000 --- a/features/steps/project/commits/user_lookup.rb +++ /dev/null @@ -1,48 +0,0 @@ -class Spinach::Features::ProjectCommitsUserLookup < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'I click on commit link' do - visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id) - end - - step 'I click on another commit link' do - visit namespace_project_commit_path(@project.namespace, @project, sample_commit.parent_id) - end - - step 'I have user with primary email' do - user_primary - end - - step 'I have user with secondary email' do - user_secondary - end - - step 'I see author based on primary email' do - check_author_link(sample_commit.author_email, user_primary) - end - - step 'I see author based on secondary email' do - check_author_link(sample_commit.author_email, user_secondary) - end - - def check_author_link(email, user) - author_link = find('.commit-author-link') - author_link['href'].should == user_path(user) - author_link['data-original-title'].should == email - find('.commit-author-name').text.should == user.name - end - - def user_primary - @user_primary ||= create(:user, email: 'dmitriy.zaporozhets@gmail.com') - end - - def user_secondary - @user_secondary ||= begin - user = create(:user, email: 'dzaporozhets@example.com') - create(:email, { user: user, email: 'dmitriy.zaporozhets@gmail.com' }) - user - end - end -end diff --git a/features/steps/project/create.rb b/features/steps/project/create.rb deleted file mode 100644 index 6b85cf74f5f..00000000000 --- a/features/steps/project/create.rb +++ /dev/null @@ -1,42 +0,0 @@ -class Spinach::Features::ProjectCreate < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - - step 'fill project form with valid data' do - fill_in 'project_path', with: 'Empty' - click_button "Create project" - end - - step 'I should see project page' do - page.should have_content "Empty" - current_path.should == namespace_project_path(Project.last.namespace, Project.last) - end - - step 'I should see empty project instuctions' do - page.should have_content "git init" - page.should have_content "git remote" - page.should have_content Project.last.url_to_repo - end - - step 'I see empty project instuctions' do - page.should have_content "git init" - page.should have_content "git remote" - page.should have_content Project.last.url_to_repo - end - - step 'I click on HTTP' do - click_button 'HTTP' - end - - step 'Remote url should update to http link' do - page.should have_content "git remote add origin #{Project.last.http_url_to_repo}" - end - - step 'If I click on SSH' do - click_button 'SSH' - end - - step 'Remote url should update to ssh link' do - page.should have_content "git remote add origin #{Project.last.url_to_repo}" - end -end diff --git a/features/steps/project/deploy_keys.rb b/features/steps/project/deploy_keys.rb deleted file mode 100644 index 50e14513a7a..00000000000 --- a/features/steps/project/deploy_keys.rb +++ /dev/null @@ -1,77 +0,0 @@ -class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'project has deploy key' do - create(:deploy_keys_project, project: @project) - end - - step 'I should see project deploy key' do - within '.enabled-keys' do - page.should have_content deploy_key.title - end - end - - step 'I should see other project deploy key' do - within '.available-keys' do - page.should have_content other_deploy_key.title - end - end - - step 'I should see public deploy key' do - within '.available-keys' do - page.should have_content public_deploy_key.title - end - end - - step 'I click \'New Deploy Key\'' do - click_link 'New Deploy Key' - end - - step 'I submit new deploy key' do - fill_in "deploy_key_title", with: "laptop" - fill_in "deploy_key_key", with: "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop" - click_button "Create" - end - - step 'I should be on deploy keys page' do - current_path.should == namespace_project_deploy_keys_path(@project.namespace, @project) - end - - step 'I should see newly created deploy key' do - within '.enabled-keys' do - page.should have_content(deploy_key.title) - end - end - - step 'other project has deploy key' do - @second_project = create :project, namespace: create(:group) - @second_project.team << [current_user, :master] - create(:deploy_keys_project, project: @second_project) - end - - step 'public deploy key exists' do - create(:deploy_key, public: true) - end - - step 'I click attach deploy key' do - within '.available-keys' do - click_link 'Enable' - end - end - - protected - - def deploy_key - @project.deploy_keys.last - end - - def other_deploy_key - @second_project.deploy_keys.last - end - - def public_deploy_key - DeployKey.are_public.last - end -end diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb deleted file mode 100644 index 8e58597db20..00000000000 --- a/features/steps/project/fork.rb +++ /dev/null @@ -1,34 +0,0 @@ -class Spinach::Features::ProjectFork < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I click link "Fork"' do - page.should have_content "Shop" - page.should have_content "Fork" - click_link "Fork" - end - - step 'I am a member of project "Shop"' do - @project = create(:project, name: "Shop") - @project.team << [@user, :reporter] - end - - step 'I should see the forked project page' do - page.should have_content "Project was successfully forked." - end - - step 'I already have a project named "Shop" in my namespace' do - @my_project = create(:project, name: "Shop", namespace: current_user.namespace) - end - - step 'I should see a "Name has already been taken" warning' do - page.should have_content "Name has already been taken" - end - - step 'I fork to my namespace' do - within '.fork-namespaces' do - click_link current_user.name - end - end -end diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb deleted file mode 100644 index 63ad90e1241..00000000000 --- a/features/steps/project/forked_merge_requests.rb +++ /dev/null @@ -1,136 +0,0 @@ -class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedNote - include SharedPaths - include Select2Helper - - step 'I am a member of project "Shop"' do - @project = Project.find_by(name: "Shop") - @project ||= create(:project, name: "Shop") - @project.team << [@user, :reporter] - @project.ensure_satellite_exists - end - - step 'I have a project forked off of "Shop" called "Forked Shop"' do - @forked_project = Projects::ForkService.new(@project, @user).execute - end - - step 'I click link "New Merge Request"' do - click_link "New Merge Request" - end - - step 'I should see merge request "Merge Request On Forked Project"' do - @project.merge_requests.size.should >= 1 - @merge_request = @project.merge_requests.last - current_path.should == namespace_project_merge_request_path(@project.namespace, @project, @merge_request) - @merge_request.title.should == "Merge Request On Forked Project" - @merge_request.source_project.should == @forked_project - @merge_request.source_branch.should == "fix" - @merge_request.target_branch.should == "master" - page.should have_content @forked_project.path_with_namespace - page.should have_content @project.path_with_namespace - page.should have_content @merge_request.source_branch - page.should have_content @merge_request.target_branch - end - - step 'I fill out a "Merge Request On Forked Project" merge request' do - select @forked_project.path_with_namespace, from: "merge_request_source_project_id" - select @project.path_with_namespace, from: "merge_request_target_project_id" - select "fix", from: "merge_request_source_branch" - select "master", from: "merge_request_target_branch" - - click_button "Compare branches" - - fill_in "merge_request_title", with: "Merge Request On Forked Project" - end - - step 'I submit the merge request' do - click_button "Submit merge request" - end - - step 'I follow the target commit link' do - commit = @project.repository.commit - click_link commit.short_id(8) - end - - step 'I should see the commit under the forked from project' do - commit = @project.repository.commit - page.should have_content(commit.message) - end - - step 'I click "Create Merge Request on fork" link' do - click_link "Create Merge Request on fork" - end - - step 'I see prefilled new Merge Request page for the forked project' do - current_path.should == new_namespace_project_merge_request_path(@forked_project.namespace, @forked_project) - find("#merge_request_source_project_id").value.should == @forked_project.id.to_s - find("#merge_request_target_project_id").value.should == @project.id.to_s - find("#merge_request_source_branch").value.should have_content "new_design" - find("#merge_request_target_branch").value.should have_content "master" - find("#merge_request_title").value.should == "New Design" - verify_commit_link(".mr_target_commit", @project) - verify_commit_link(".mr_source_commit", @forked_project) - end - - step 'I update the merge request title' do - fill_in "merge_request_title", with: "An Edited Forked Merge Request" - end - - step 'I save the merge request' do - click_button "Save changes" - end - - step 'I should see the edited merge request' do - page.should have_content "An Edited Forked Merge Request" - @project.merge_requests.size.should >= 1 - @merge_request = @project.merge_requests.last - current_path.should == namespace_project_merge_request_path(@project.namespace, @project, @merge_request) - @merge_request.source_project.should == @forked_project - @merge_request.source_branch.should == "fix" - @merge_request.target_branch.should == "master" - page.should have_content @forked_project.path_with_namespace - page.should have_content @project.path_with_namespace - page.should have_content @merge_request.source_branch - page.should have_content @merge_request.target_branch - end - - step 'I should see last push widget' do - page.should have_content "You pushed to new_design" - page.should have_link "Create Merge Request" - end - - step 'I click link edit "Merge Request On Forked Project"' do - find("#edit_merge_request").click - end - - step 'I see the edit page prefilled for "Merge Request On Forked Project"' do - current_path.should == edit_namespace_project_merge_request_path(@project.namespace, @project, @merge_request) - page.should have_content "Edit merge request ##{@merge_request.id}" - find("#merge_request_title").value.should == "Merge Request On Forked Project" - end - - step 'I fill out an invalid "Merge Request On Forked Project" merge request' do - select "Select branch", from: "merge_request_target_branch" - find(:select, "merge_request_source_project_id", {}).value.should == @forked_project.id.to_s - find(:select, "merge_request_target_project_id", {}).value.should == @project.id.to_s - find(:select, "merge_request_source_branch", {}).value.should == "" - find(:select, "merge_request_target_branch", {}).value.should == "" - click_button "Compare branches" - end - - step 'I should see validation errors' do - page.should have_content "You must select source and target branch" - end - - step 'the target repository should be the original repository' do - page.should have_select("merge_request_target_project_id", selected: @project.path_with_namespace) - end - - # Verify a link is generated against the correct project - def verify_commit_link(container_div, container_project) - # This should force a wait for the javascript to execute - find(:div,container_div).find(".commit_short_id")['href'].should have_content "#{container_project.path_with_namespace}/commit" - end -end diff --git a/features/steps/project/graph.rb b/features/steps/project/graph.rb deleted file mode 100644 index a2807c340f6..00000000000 --- a/features/steps/project/graph.rb +++ /dev/null @@ -1,23 +0,0 @@ -class Spinach::Features::ProjectGraph < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - - step 'page should have graphs' do - page.should have_selector ".stat-graph" - end - - When 'I visit project "Shop" graph page' do - project = Project.find_by(name: "Shop") - visit namespace_project_graph_path(project.namespace, project, "master") - end - - step 'I visit project "Shop" commits graph page' do - project = Project.find_by(name: "Shop") - visit commits_namespace_project_graph_path(project.namespace, project, "master") - end - - step 'page should have commits graphs' do - page.should have_content "Commit statistics for master" - page.should have_content "Commits per day of month" - end -end diff --git a/features/steps/project/hooks.rb b/features/steps/project/hooks.rb deleted file mode 100644 index 4b135202593..00000000000 --- a/features/steps/project/hooks.rb +++ /dev/null @@ -1,64 +0,0 @@ -require 'webmock' - -class Spinach::Features::ProjectHooks < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - include RSpec::Matchers - include RSpec::Mocks::ExampleMethods - include WebMock::API - - step 'project has hook' do - @hook = create(:project_hook, project: current_project) - end - - step 'I own empty project with hook' do - @project = create(:empty_project, - name: 'Empty Project', namespace: @user.namespace) - @hook = create(:project_hook, project: current_project) - end - - step 'I should see project hook' do - page.should have_content @hook.url - end - - step 'I submit new hook' do - @url = Faker::Internet.uri("http") - fill_in "hook_url", with: @url - expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1) - end - - step 'I should see newly created hook' do - current_path.should == namespace_project_hooks_path(current_project.namespace, current_project) - page.should have_content(@url) - end - - step 'I click test hook button' do - stub_request(:post, @hook.url).to_return(status: 200) - click_link 'Test Hook' - end - - step 'I click test hook button with invalid URL' do - stub_request(:post, @hook.url).to_raise(SocketError) - click_link 'Test Hook' - end - - step 'hook should be triggered' do - current_path.should == namespace_project_hooks_path(current_project.namespace, current_project) - page.should have_selector '.flash-notice', - text: 'Hook successfully executed.' - end - - step 'I should see hook error message' do - page.should have_selector '.flash-alert', - text: 'Hook execution failed. '\ - 'Ensure the project has commits.' - end - - step 'I should see hook service down error message' do - page.should have_selector '.flash-alert', - text: 'Hook execution failed. '\ - 'Ensure hook URL is correct and '\ - 'service is up.' - end -end diff --git a/features/steps/project/issues/filter_labels.rb b/features/steps/project/issues/filter_labels.rb deleted file mode 100644 index 5740bd12837..00000000000 --- a/features/steps/project/issues/filter_labels.rb +++ /dev/null @@ -1,60 +0,0 @@ -class Spinach::Features::ProjectIssuesFilterLabels < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - include Select2Helper - - step 'I should see "Bugfix1" in issues list' do - within ".issues-list" do - page.should have_content "Bugfix1" - end - end - - step 'I should see "Bugfix2" in issues list' do - within ".issues-list" do - page.should have_content "Bugfix2" - end - end - - step 'I should not see "Bugfix2" in issues list' do - within ".issues-list" do - page.should_not have_content "Bugfix2" - end - end - - step 'I should not see "Feature1" in issues list' do - within ".issues-list" do - page.should_not have_content "Feature1" - end - end - - step 'I click link "bug"' do - select2('bug', from: "#label_name") - end - - step 'I click link "feature"' do - within ".labels-filter" do - click_link "feature" - end - end - - step 'project "Shop" has issue "Bugfix1" with labels: "bug", "feature"' do - project = Project.find_by(name: "Shop") - issue = create(:issue, title: "Bugfix1", project: project) - issue.labels << project.labels.find_by(title: 'bug') - issue.labels << project.labels.find_by(title: 'feature') - end - - step 'project "Shop" has issue "Bugfix2" with labels: "bug", "enhancement"' do - project = Project.find_by(name: "Shop") - issue = create(:issue, title: "Bugfix2", project: project) - issue.labels << project.labels.find_by(title: 'bug') - issue.labels << project.labels.find_by(title: 'enhancement') - end - - step 'project "Shop" has issue "Feature1" with labels: "feature"' do - project = Project.find_by(name: "Shop") - issue = create(:issue, title: "Feature1", project: project) - issue.labels << project.labels.find_by(title: 'feature') - end -end diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb deleted file mode 100644 index b8e282b2029..00000000000 --- a/features/steps/project/issues/issues.rb +++ /dev/null @@ -1,276 +0,0 @@ -class Spinach::Features::ProjectIssues < Spinach::FeatureSteps - include SharedAuthentication - include SharedIssuable - include SharedProject - include SharedNote - include SharedPaths - include SharedMarkdown - - step 'I should see "Release 0.4" in issues' do - page.should have_content "Release 0.4" - end - - step 'I should not see "Release 0.3" in issues' do - page.should_not have_content "Release 0.3" - end - - step 'I should not see "Tweet control" in issues' do - page.should_not have_content "Tweet control" - end - - step 'I should see that I am subscribed' do - find(".subscribe-button span").text.should == "Unsubscribe" - end - - step 'I should see that I am unsubscribed' do - sleep 0.2 - find(".subscribe-button span").text.should == "Subscribe" - end - - step 'I click link "Closed"' do - click_link "Closed" - end - - step 'I click button "Unsubscribe"' do - click_on "Unsubscribe" - end - - step 'I should see "Release 0.3" in issues' do - page.should have_content "Release 0.3" - end - - step 'I should not see "Release 0.4" in issues' do - page.should_not have_content "Release 0.4" - end - - step 'I click link "All"' do - click_link "All" - end - - step 'I click link "Release 0.4"' do - click_link "Release 0.4" - end - - step 'I should see issue "Release 0.4"' do - page.should have_content "Release 0.4" - end - - step 'I click link "New Issue"' do - click_link "New Issue" - end - - step 'I click "author" dropdown' do - first('.ajax-users-select').click - end - - step 'I see current user as the first user' do - expect(page).to have_selector('.user-result', visible: true, count: 4) - users = page.all('.user-name') - users[0].text.should == 'Any' - users[1].text.should == 'Unassigned' - users[2].text.should == current_user.name - end - - step 'I submit new issue "500 error on profile"' do - fill_in "issue_title", with: "500 error on profile" - click_button "Submit new issue" - end - - step 'I submit new issue "500 error on profile" with label \'bug\'' do - fill_in "issue_title", with: "500 error on profile" - select 'bug', from: "Labels" - click_button "Submit new issue" - end - - step 'I click link "500 error on profile"' do - click_link "500 error on profile" - end - - step 'I should see label \'bug\' with issue' do - within '.issue-show-labels' do - page.should have_content 'bug' - end - end - - step 'I should see issue "500 error on profile"' do - issue = Issue.find_by(title: "500 error on profile") - page.should have_content issue.title - page.should have_content issue.author_name - page.should have_content issue.project.name - end - - step 'I fill in issue search with "Re"' do - filter_issue "Re" - end - - step 'I fill in issue search with "Bu"' do - filter_issue "Bu" - end - - step 'I fill in issue search with ".3"' do - filter_issue ".3" - end - - step 'I fill in issue search with "Something"' do - filter_issue "Something" - end - - step 'I fill in issue search with ""' do - filter_issue "" - end - - step 'project "Shop" has milestone "v2.2"' do - - milestone = create(:milestone, title: "v2.2", project: project) - - 3.times { create(:issue, project: project, milestone: milestone) } - end - - step 'project "Shop" has milestone "v3.0"' do - - milestone = create(:milestone, title: "v3.0", project: project) - - 3.times { create(:issue, project: project, milestone: milestone) } - end - - When 'I select milestone "v3.0"' do - select "v3.0", from: "milestone_id" - end - - step 'I should see selected milestone with title "v3.0"' do - issues_milestone_selector = "#issue_milestone_id_chzn > a" - find(issues_milestone_selector).should have_content("v3.0") - end - - When 'I select first assignee from "Shop" project' do - - first_assignee = project.users.first - select first_assignee.name, from: "assignee_id" - end - - step 'I should see first assignee from "Shop" as selected assignee' do - issues_assignee_selector = "#issue_assignee_id_chzn > a" - - assignee_name = project.users.first.name - find(issues_assignee_selector).should have_content(assignee_name) - end - - step 'project "Shop" have "Release 0.4" open issue' do - - create(:issue, - title: "Release 0.4", - project: project, - author: project.users.first, - description: "# Description header" - ) - end - - step 'project "Shop" have "Tweet control" open issue' do - create(:issue, - title: "Tweet control", - project: project, - author: project.users.first) - end - - step 'project "Shop" have "Release 0.3" closed issue' do - create(:closed_issue, - title: "Release 0.3", - project: project, - author: project.users.first) - end - - step 'project "Shop" has "Tasks-open" open issue with task markdown' do - create_taskable(:issue, 'Tasks-open') - end - - step 'project "Shop" has "Tasks-closed" closed issue with task markdown' do - create_taskable(:closed_issue, 'Tasks-closed') - end - - step 'empty project "Empty Project"' do - create :empty_project, name: 'Empty Project', namespace: @user.namespace - end - - When 'I visit empty project page' do - project = Project.find_by(name: 'Empty Project') - visit namespace_project_path(project.namespace, project) - end - - step 'I see empty project details with ssh clone info' do - project = Project.find_by(name: 'Empty Project') - all(:css, '.git-empty .clone').each do |element| - element.text.should include(project.url_to_repo) - end - end - - When "I visit empty project's issues page" do - project = Project.find_by(name: 'Empty Project') - visit namespace_project_issues_path(project.namespace, project) - end - - step 'I leave a comment with code block' do - within(".js-main-target-form") do - fill_in "note[note]", with: "```\nCommand [1]: /usr/local/bin/git , see [text](doc/text)\n```" - click_button "Add Comment" - sleep 0.05 - end - end - - step 'I should see an error alert section within the comment form' do - within(".js-main-target-form") do - find(".error-alert") - end - end - - step 'The code block should be unchanged' do - page.should have_content("```\nCommand [1]: /usr/local/bin/git , see [text](doc/text)\n```") - end - - step 'project \'Shop\' has issue \'Bugfix1\' with description: \'Description for issue1\'' do - issue = create(:issue, title: 'Bugfix1', description: 'Description for issue1', project: project) - end - - step 'project \'Shop\' has issue \'Feature1\' with description: \'Feature submitted for issue1\'' do - issue = create(:issue, title: 'Feature1', description: 'Feature submitted for issue1', project: project) - end - - step 'I fill in issue search with \'Description for issue1\'' do - filter_issue 'Description for issue' - end - - step 'I fill in issue search with \'issue1\'' do - filter_issue 'issue1' - end - - step 'I fill in issue search with \'Rock and roll\'' do - filter_issue 'Description for issue' - end - - step 'I should see \'Bugfix1\' in issues' do - page.should have_content 'Bugfix1' - end - - step 'I should see \'Feature1\' in issues' do - page.should have_content 'Feature1' - end - - step 'I should not see \'Bugfix1\' in issues' do - page.should_not have_content 'Bugfix1' - end - - step 'issue \'Release 0.4\' has label \'bug\'' do - label = project.labels.create!(name: 'bug', color: '#990000') - issue = Issue.find_by!(title: 'Release 0.4') - issue.labels << label - end - - step 'I click label \'bug\'' do - within ".issues-list" do - click_link 'bug' - end - end - - def filter_issue(text) - fill_in 'issue_search', with: text - end -end diff --git a/features/steps/project/issues/labels.rb b/features/steps/project/issues/labels.rb deleted file mode 100644 index 6ce34c500c6..00000000000 --- a/features/steps/project/issues/labels.rb +++ /dev/null @@ -1,101 +0,0 @@ -class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'I visit \'bug\' label edit page' do - visit edit_namespace_project_label_path(project.namespace, project, bug_label) - end - - step 'I remove label \'bug\'' do - within "#label_#{bug_label.id}" do - click_link 'Remove' - end - end - - step 'I delete all labels' do - within '.labels' do - all('.btn-remove').each do |remove| - remove.click - sleep 0.05 - end - end - end - - step 'I should see labels help message' do - within '.labels' do - page.should have_content 'Create first label or generate default set of '\ - 'labels' - end - end - - step 'I submit new label \'support\'' do - fill_in 'Title', with: 'support' - fill_in 'Background Color', with: '#F95610' - click_button 'Save' - end - - step 'I submit new label \'bug\'' do - fill_in 'Title', with: 'bug' - fill_in 'Background Color', with: '#F95610' - click_button 'Save' - end - - step 'I submit new label with invalid color' do - fill_in 'Title', with: 'support' - fill_in 'Background Color', with: '#12' - click_button 'Save' - end - - step 'I should see label label exist error message' do - within '.label-form' do - page.should have_content 'Title has already been taken' - end - end - - step 'I should see label color error message' do - within '.label-form' do - page.should have_content 'Color is invalid' - end - end - - step 'I should see label \'feature\'' do - within '.manage-labels-list' do - page.should have_content 'feature' - end - end - - step 'I should see label \'bug\'' do - within '.manage-labels-list' do - page.should have_content 'bug' - end - end - - step 'I should not see label \'bug\'' do - within '.manage-labels-list' do - page.should_not have_content 'bug' - end - end - - step 'I should see label \'support\'' do - within '.manage-labels-list' do - page.should have_content 'support' - end - end - - step 'I change label \'bug\' to \'fix\'' do - fill_in 'Title', with: 'fix' - fill_in 'Background Color', with: '#F15610' - click_button 'Save' - end - - step 'I should see label \'fix\'' do - within '.manage-labels-list' do - page.should have_content 'fix' - end - end - - def bug_label - project.labels.find_or_create_by(title: 'bug') - end -end diff --git a/features/steps/project/issues/milestones.rb b/features/steps/project/issues/milestones.rb deleted file mode 100644 index cce87a6d981..00000000000 --- a/features/steps/project/issues/milestones.rb +++ /dev/null @@ -1,59 +0,0 @@ -class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - include SharedMarkdown - - step 'I should see milestone "v2.2"' do - milestone = @project.milestones.find_by(title: "v2.2") - page.should have_content(milestone.title[0..10]) - page.should have_content(milestone.expires_at) - page.should have_content("Issues") - end - - step 'I click link "v2.2"' do - click_link "v2.2" - end - - step 'I click link "New Milestone"' do - click_link "New Milestone" - end - - step 'I submit new milestone "v2.3"' do - fill_in "milestone_title", with: "v2.3" - click_button "Create milestone" - end - - step 'I should see milestone "v2.3"' do - milestone = @project.milestones.find_by(title: "v2.3") - page.should have_content(milestone.title[0..10]) - page.should have_content(milestone.expires_at) - page.should have_content("Issues") - end - - step 'project "Shop" has milestone "v2.2"' do - project = Project.find_by(name: "Shop") - milestone = create(:milestone, - title: "v2.2", - project: project, - description: "# Description header" - ) - 3.times { create(:issue, project: project, milestone: milestone) } - end - - step 'the milestone has open and closed issues' do - project = Project.find_by(name: "Shop") - milestone = project.milestones.find_by(title: 'v2.2') - - # 3 Open issues created above; create one closed issue - create(:closed_issue, project: project, milestone: milestone) - end - - When 'I click link "All Issues"' do - click_link 'All Issues' - end - - step 'I should see 3 issues' do - page.should have_selector('#tab-issues li.issue-row', count: 4) - end -end diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb deleted file mode 100644 index bb1f9f129c0..00000000000 --- a/features/steps/project/merge_requests.rb +++ /dev/null @@ -1,337 +0,0 @@ -class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps - include SharedAuthentication - include SharedIssuable - include SharedProject - include SharedNote - include SharedPaths - include SharedMarkdown - include SharedDiffNote - - step 'I click link "New Merge Request"' do - click_link "New Merge Request" - end - - step 'I click link "Bug NS-04"' do - click_link "Bug NS-04" - end - - step 'I click link "All"' do - click_link "All" - end - - step 'I click link "Closed"' do - click_link "Closed" - end - - step 'I should see merge request "Wiki Feature"' do - within '.merge-request' do - page.should have_content "Wiki Feature" - end - end - - step 'I should see closed merge request "Bug NS-04"' do - merge_request = MergeRequest.find_by!(title: "Bug NS-04") - merge_request.closed?.should be_true - page.should have_content "Closed by" - end - - step 'I should see merge request "Bug NS-04"' do - page.should have_content "Bug NS-04" - end - - step 'I should see "Bug NS-04" in merge requests' do - page.should have_content "Bug NS-04" - end - - step 'I should see "Feature NS-03" in merge requests' do - page.should have_content "Feature NS-03" - end - - step 'I should not see "Feature NS-03" in merge requests' do - page.should_not have_content "Feature NS-03" - end - - - step 'I should not see "Bug NS-04" in merge requests' do - page.should_not have_content "Bug NS-04" - end - - step 'I should see that I am subscribed' do - find(".subscribe-button span").text.should == "Unsubscribe" - end - - step 'I should see that I am unsubscribed' do - find(".subscribe-button span").should have_content("Subscribe") - end - - step 'I click button "Unsubscribe"' do - click_on "Unsubscribe" - end - - step 'I click link "Close"' do - first(:css, '.close-mr-link').click - end - - step 'I submit new merge request "Wiki Feature"' do - select "fix", from: "merge_request_source_branch" - select "feature", from: "merge_request_target_branch" - click_button "Compare branches" - fill_in "merge_request_title", with: "Wiki Feature" - click_button "Submit merge request" - end - - step 'project "Shop" have "Bug NS-04" open merge request' do - create(:merge_request, - title: "Bug NS-04", - source_project: project, - target_project: project, - source_branch: 'fix', - target_branch: 'master', - author: project.users.first, - description: "# Description header" - ) - end - - step 'project "Shop" have "Bug NS-05" open merge request with diffs inside' do - create(:merge_request_with_diffs, - title: "Bug NS-05", - source_project: project, - target_project: project, - author: project.users.first) - end - - step 'project "Shop" have "Feature NS-03" closed merge request' do - create(:closed_merge_request, - title: "Feature NS-03", - source_project: project, - target_project: project, - author: project.users.first) - end - - step 'project "Shop" has "MR-task-open" open MR with task markdown' do - create_taskable(:merge_request, 'MR-task-open') - end - - step 'I switch to the diff tab' do - visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request) - end - - step 'I click on the Changes tab via Javascript' do - find('.diffs-tab').click - sleep 2 - end - - step 'I should see the proper Inline and Side-by-side links' do - buttons = all('#commit-diff-viewtype') - expect(buttons.count).to eq(2) - - buttons.each do |b| - expect(b['href']).should_not have_content('json') - end - end - - step 'I switch to the merge request\'s comments tab' do - visit namespace_project_merge_request_path(project.namespace, project, merge_request) - end - - step 'I click on the commit in the merge request' do - within '.merge-request-tabs' do - click_link 'Commits' - end - - within '.commits' do - click_link Commit.truncate_sha(sample_commit.id) - end - end - - step 'I leave a comment on the diff page' do - init_diff_note - leave_comment "One comment to rule them all" - end - - step 'I leave a comment on the diff page in commit' do - click_diff_line(sample_commit.line_code) - leave_comment "One comment to rule them all" - end - - step 'I leave a comment like "Line is wrong" on diff' do - init_diff_note - leave_comment "Line is wrong" - end - - step 'I leave a comment like "Line is wrong" on diff in commit' do - click_diff_line(sample_commit.line_code) - leave_comment "Line is wrong" - end - - step 'I should see a discussion has started on diff' do - page.should have_content "#{current_user.name} started a discussion" - page.should have_content sample_commit.line_code_path - page.should have_content "Line is wrong" - end - - step 'I should see a discussion has started on commit diff' do - page.should have_content "#{current_user.name} started a discussion on commit" - page.should have_content sample_commit.line_code_path - page.should have_content "Line is wrong" - end - - step 'I should see a discussion has started on commit' do - page.should have_content "#{current_user.name} started a discussion on commit" - page.should have_content "One comment to rule them all" - end - - step 'merge request is mergeable' do - page.should have_button 'Accept Merge Request' - end - - step 'I modify merge commit message' do - find('.modify-merge-commit-link').click - fill_in 'commit_message', with: 'wow such merge' - end - - step 'merge request "Bug NS-05" is mergeable' do - merge_request.mark_as_mergeable - end - - step 'I accept this merge request' do - Gitlab::Satellite::MergeAction.any_instance.stub( - merge!: true, - ) - - within '.can_be_merged' do - click_button "Accept Merge Request" - end - end - - step 'I should see merged request' do - within '.issue-box' do - page.should have_content "Merged" - end - end - - step 'I click link "Reopen"' do - first(:css, '.reopen-mr-link').click - end - - step 'I should see reopened merge request "Bug NS-04"' do - within '.issue-box' do - page.should have_content "Open" - end - end - - step 'I click link "Hide inline discussion" of the second file' do - within '.files [id^=diff]:nth-child(2)' do - find('.js-toggle-diff-comments').click - end - end - - step 'I click link "Show inline discussion" of the second file' do - within '.files [id^=diff]:nth-child(2)' do - find('.js-toggle-diff-comments').click - end - end - - step 'I should not see a comment like "Line is wrong" in the second file' do - within '.files [id^=diff]:nth-child(2)' do - page.should_not have_visible_content "Line is wrong" - end - end - - step 'I should see a comment like "Line is wrong" in the second file' do - within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do - page.should have_visible_content "Line is wrong" - end - end - - step 'I should not see a comment like "Line is wrong here" in the second file' do - within '.files [id^=diff]:nth-child(2)' do - page.should_not have_visible_content "Line is wrong here" - end - end - - step 'I should see a comment like "Line is wrong here" in the second file' do - within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do - page.should have_visible_content "Line is wrong here" - end - end - - step 'I leave a comment like "Line is correct" on line 12 of the first file' do - init_diff_note_first_file - - within(".js-discussion-note-form") do - fill_in "note_note", with: "Line is correct" - click_button "Add Comment" - end - - within ".files [id^=diff]:nth-child(1) .note-body > .note-text" do - page.should have_content "Line is correct" - end - end - - step 'I leave a comment like "Line is wrong" on line 39 of the second file' do - init_diff_note_second_file - - within(".js-discussion-note-form") do - fill_in "note_note", with: "Line is wrong on here" - click_button "Add Comment" - end - end - - step 'I should still see a comment like "Line is correct" in the first file' do - within '.files [id^=diff]:nth-child(1) .note-body > .note-text' do - page.should have_visible_content "Line is correct" - end - end - - step 'I unfold diff' do - first('.js-unfold').click - end - - step 'I should see additional file lines' do - expect(first('.text-file')).to have_content('.bundle') - end - - step 'I click Side-by-side Diff tab' do - find('a', text: 'Side-by-side').trigger('click') - end - - step 'I should see comments on the side-by-side diff page' do - within '.files [id^=diff]:nth-child(1) .parallel .note-body > .note-text' do - page.should have_visible_content "Line is correct" - end - end - - step 'I fill in merge request search with "Fe"' do - fill_in 'issue_search', with: "Fe" - end - - def merge_request - @merge_request ||= MergeRequest.find_by!(title: "Bug NS-05") - end - - def init_diff_note - click_diff_line(sample_commit.line_code) - end - - def leave_comment(message) - within(".js-discussion-note-form") do - fill_in "note_note", with: message - click_button "Add Comment" - end - - page.should have_content message - end - - def init_diff_note_first_file - click_diff_line(sample_compare.changes[0][:line_code]) - end - - def init_diff_note_second_file - click_diff_line(sample_compare.changes[1][:line_code]) - end - - def have_visible_content (text) - have_css("*", text: text, visible: true) - end -end diff --git a/features/steps/project/network_graph.rb b/features/steps/project/network_graph.rb deleted file mode 100644 index a15688ace6a..00000000000 --- a/features/steps/project/network_graph.rb +++ /dev/null @@ -1,93 +0,0 @@ -class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'page should have network graph' do - page.should have_selector ".network-graph" - end - - When 'I visit project "Shop" network page' do - # Stub Graph max_size to speed up test (10 commits vs. 650) - Network::Graph.stub(max_count: 10) - - project = Project.find_by(name: "Shop") - visit namespace_project_network_path(project.namespace, project, "master") - end - - step 'page should select "master" in select box' do - page.should have_selector '.select2-chosen', text: "master" - end - - step 'page should select "v1.0.0" in select box' do - page.should have_selector '.select2-chosen', text: "v1.0.0" - end - - step 'page should have "master" on graph' do - within '.network-graph' do - page.should have_content 'master' - end - end - - When 'I switch ref to "feature"' do - select 'feature', from: 'ref' - sleep 2 - end - - When 'I switch ref to "v1.0.0"' do - select 'v1.0.0', from: 'ref' - sleep 2 - end - - When 'click "Show only selected branch" checkbox' do - find('#filter_ref').click - sleep 2 - end - - step 'page should have content not containing "v1.0.0"' do - within '.network-graph' do - page.should have_content 'Change some files' - end - end - - step 'page should not have content not containing "v1.0.0"' do - within '.network-graph' do - page.should_not have_content 'Change some files' - end - end - - step 'page should select "feature" in select box' do - page.should have_selector '.select2-chosen', text: "feature" - end - - step 'page should select "v1.0.0" in select box' do - page.should have_selector '.select2-chosen', text: "v1.0.0" - end - - step 'page should have "feature" on graph' do - within '.network-graph' do - page.should have_content 'feature' - end - end - - When 'I looking for a commit by SHA of "v1.0.0"' do - within ".network-form" do - fill_in 'extended_sha1', with: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9' - find('button').click - end - sleep 2 - end - - step 'page should have "v1.0.0" on graph' do - within '.network-graph' do - page.should have_content 'v1.0.0' - end - end - - When 'I look for a commit by ";"' do - within ".network-form" do - fill_in 'extended_sha1', with: ';' - find('button').click - end - end -end diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb deleted file mode 100644 index d39c8e7d2db..00000000000 --- a/features/steps/project/project.rb +++ /dev/null @@ -1,97 +0,0 @@ -class Spinach::Features::Project < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'change project settings' do - fill_in 'project_name_edit', with: 'NewName' - uncheck 'project_issues_enabled' - end - - step 'I save project' do - click_button 'Save changes' - end - - step 'I should see project with new settings' do - find_field('project_name').value.should == 'NewName' - 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 - project.path.should == 'new-path' - end - - step 'I change the project avatar' do - attach_file( - :project_avatar, - File.join(Rails.root, 'public', 'gitlab_logo.png') - ) - click_button 'Save changes' - @project.reload - end - - step 'I should see new project avatar' do - @project.avatar.should be_instance_of AvatarUploader - url = @project.avatar.url - url.should == "/uploads/project/avatar/#{ @project.id }/gitlab_logo.png" - end - - step 'I should see the "Remove avatar" button' do - page.should have_link('Remove avatar') - end - - step 'I have an project avatar' do - attach_file( - :project_avatar, - File.join(Rails.root, 'public', 'gitlab_logo.png') - ) - 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 - @project.avatar?.should be_false - end - - step 'I should not see the "Remove avatar" button' do - page.should_not have_link('Remove avatar') - end - - step 'I should see project "Shop" version' do - within '.project-side' do - page.should have_content 'Version: 6.7.0.pre' - end - end - - step 'change project default branch' do - select 'fix', from: 'project_default_branch' - click_button 'Save changes' - end - - step 'I should see project default branch changed' do - find(:css, 'select#project_default_branch').value.should == 'fix' - end - - step 'I select project "Forum" README tab' do - click_link 'Readme' - end - - step 'I should see project "Forum" README' do - page.should have_link 'README.md' - page.should have_content 'Sample repo for testing gitlab features' - end - - step 'I should see project "Shop" README' do - page.should have_link 'README.md' - page.should have_content 'testme' - end -end diff --git a/features/steps/project/project_shortcuts.rb b/features/steps/project/project_shortcuts.rb deleted file mode 100644 index a10e7bf78ee..00000000000 --- a/features/steps/project/project_shortcuts.rb +++ /dev/null @@ -1,36 +0,0 @@ -class Spinach::Features::ProjectShortcuts < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - include SharedProjectTab - - step 'I press "g" and "f"' do - find('body').native.send_key('g') - find('body').native.send_key('f') - end - - step 'I press "g" and "c"' do - find('body').native.send_key('g') - find('body').native.send_key('c') - end - - step 'I press "g" and "n"' do - find('body').native.send_key('g') - find('body').native.send_key('n') - end - - step 'I press "g" and "g"' do - find('body').native.send_key('g') - find('body').native.send_key('g') - end - - step 'I press "g" and "s"' do - find('body').native.send_key('g') - find('body').native.send_key('s') - end - - step 'I press "g" and "w"' do - find('body').native.send_key('g') - find('body').native.send_key('w') - end -end diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb deleted file mode 100644 index 57c6e39c801..00000000000 --- a/features/steps/project/redirects.rb +++ /dev/null @@ -1,69 +0,0 @@ -class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'public project "Community"' do - create :project, :public, name: 'Community' - end - - step 'private project "Enterprise"' do - create :project, name: 'Enterprise' - end - - step 'I visit project "Community" page' do - project = Project.find_by(name: 'Community') - visit namespace_project_path(project.namespace, project) - end - - step 'I should see project "Community" home page' do - Gitlab.config.gitlab.should_receive(:host).and_return("www.example.com") - within '.navbar-gitlab .title' do - page.should have_content 'Community' - end - end - - step 'I visit project "Enterprise" page' do - project = Project.find_by(name: 'Enterprise') - visit namespace_project_path(project.namespace, project) - end - - step 'I visit project "CommunityDoesNotExist" page' do - project = Project.find_by(name: 'Community') - visit namespace_project_path(project.namespace, project) + 'DoesNotExist' - end - - step 'I click on "Sign In"' do - first(:link, "Sign in").click - end - - step 'Authenticate' do - admin = create(:admin) - project = Project.find_by(name: 'Community') - fill_in "user_login", with: admin.email - fill_in "user_password", with: admin.password - click_button "Sign in" - Thread.current[:current_user] = admin - end - - step 'I should be redirected to "Community" page' do - project = Project.find_by(name: 'Community') - current_path.should == "/#{project.path_with_namespace}" - status_code.should == 200 - end - - step 'I get redirected to signin page where I sign in' do - admin = create(:admin) - project = Project.find_by(name: 'Enterprise') - fill_in "user_login", with: admin.email - fill_in "user_password", with: admin.password - click_button "Sign in" - Thread.current[:current_user] = admin - end - - step 'I should be redirected to "Enterprise" page' do - project = Project.find_by(name: 'Enterprise') - current_path.should == "/#{project.path_with_namespace}" - status_code.should == 200 - end -end diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb deleted file mode 100644 index 4b3d79324ab..00000000000 --- a/features/steps/project/services.rb +++ /dev/null @@ -1,225 +0,0 @@ -class Spinach::Features::ProjectServices < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'I visit project "Shop" services page' do - visit namespace_project_services_path(@project.namespace, @project) - end - - step 'I should see list of available services' do - page.should have_content 'Project services' - page.should have_content 'Campfire' - page.should have_content 'HipChat' - page.should have_content 'GitLab CI' - page.should have_content 'Assembla' - page.should have_content 'Pushover' - page.should have_content 'Atlassian Bamboo' - page.should have_content 'JetBrains TeamCity' - page.should have_content 'Asana' - page.should have_content 'Irker (IRC gateway)' - end - - step 'I click gitlab-ci service link' do - click_link 'GitLab CI' - end - - step 'I fill gitlab-ci settings' do - check 'Active' - fill_in 'Project url', with: 'http://ci.gitlab.org/projects/3' - fill_in 'Token', with: 'verySecret' - click_button 'Save' - end - - step 'I should see service settings saved' do - find_field('Project url').value.should == 'http://ci.gitlab.org/projects/3' - end - - step 'I click hipchat service link' do - click_link 'HipChat' - end - - step 'I fill hipchat settings' do - check 'Active' - fill_in 'Room', with: 'gitlab' - fill_in 'Token', with: 'verySecret' - click_button 'Save' - end - - step 'I should see hipchat service settings saved' do - find_field('Room').value.should == 'gitlab' - end - - step 'I fill hipchat settings with custom server' do - check 'Active' - fill_in 'Room', with: 'gitlab_custom' - fill_in 'Token', with: 'secretCustom' - fill_in 'Server', with: 'https://chat.example.com' - click_button 'Save' - end - - step 'I should see hipchat service settings with custom server saved' do - find_field('Server').value.should == 'https://chat.example.com' - end - - step 'I click pivotaltracker service link' do - click_link 'PivotalTracker' - end - - step 'I fill pivotaltracker settings' do - check 'Active' - fill_in 'Token', with: 'verySecret' - click_button 'Save' - end - - step 'I should see pivotaltracker service settings saved' do - find_field('Token').value.should == 'verySecret' - end - - step 'I click Flowdock service link' do - click_link 'Flowdock' - end - - step 'I fill Flowdock settings' do - check 'Active' - fill_in 'Token', with: 'verySecret' - click_button 'Save' - end - - step 'I should see Flowdock service settings saved' do - find_field('Token').value.should == 'verySecret' - end - - step 'I click Assembla service link' do - click_link 'Assembla' - end - - step 'I fill Assembla settings' do - check 'Active' - fill_in 'Token', with: 'verySecret' - click_button 'Save' - end - - step 'I should see Assembla service settings saved' do - find_field('Token').value.should == 'verySecret' - end - - step 'I click Asana service link' do - click_link 'Asana' - end - - step 'I fill Asana settings' do - check 'Active' - fill_in 'Api key', with: 'verySecret' - fill_in 'Restrict to branch', with: 'master' - click_button 'Save' - end - - step 'I should see Asana service settings saved' do - find_field('Api key').value.should == 'verySecret' - find_field('Restrict to branch').value.should == 'master' - end - - step 'I click email on push service link' do - click_link 'Emails on push' - end - - step 'I fill email on push settings' do - fill_in 'Recipients', with: 'qa@company.name' - click_button 'Save' - end - - step 'I should see email on push service settings saved' do - find_field('Recipients').value.should == 'qa@company.name' - end - - step 'I click Irker service link' do - click_link 'Irker (IRC gateway)' - end - - step 'I fill Irker settings' do - check 'Active' - fill_in 'Recipients', with: 'irc://chat.freenode.net/#commits' - check 'Colorize messages' - click_button 'Save' - end - - step 'I should see Irker service settings saved' do - find_field('Recipients').value.should == 'irc://chat.freenode.net/#commits' - find_field('Colorize messages').value.should == '1' - end - - step 'I click Slack service link' do - click_link 'Slack' - end - - step 'I fill Slack settings' do - check 'Active' - fill_in 'Webhook', with: 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685' - click_button 'Save' - end - - step 'I should see Slack service settings saved' do - find_field('Webhook').value.should == 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685' - end - - step 'I click Pushover service link' do - click_link 'Pushover' - end - - step 'I fill Pushover settings' do - check 'Active' - fill_in 'Api key', with: 'verySecret' - fill_in 'User key', with: 'verySecret' - fill_in 'Device', with: 'myDevice' - select 'High Priority', from: 'Priority' - select 'Bike', from: 'Sound' - click_button 'Save' - end - - step 'I should see Pushover service settings saved' do - find_field('Api key').value.should == 'verySecret' - find_field('User key').value.should == 'verySecret' - find_field('Device').value.should == 'myDevice' - find_field('Priority').find('option[selected]').value.should == '1' - find_field('Sound').find('option[selected]').value.should == 'bike' - end - - step 'I click Atlassian Bamboo CI service link' do - click_link 'Atlassian Bamboo CI' - end - - step 'I fill Atlassian Bamboo CI settings' do - check 'Active' - fill_in 'Bamboo url', with: 'http://bamboo.example.com' - fill_in 'Build key', with: 'KEY' - fill_in 'Username', with: 'user' - fill_in 'Password', with: 'verySecret' - click_button 'Save' - end - - step 'I should see Atlassian Bamboo CI service settings saved' do - find_field('Bamboo url').value.should == 'http://bamboo.example.com' - find_field('Build key').value.should == 'KEY' - find_field('Username').value.should == 'user' - end - - step 'I click JetBrains TeamCity CI service link' do - click_link 'JetBrains TeamCity CI' - end - - step 'I fill JetBrains TeamCity CI settings' do - check 'Active' - fill_in 'Teamcity url', with: 'http://teamcity.example.com' - fill_in 'Build type', with: 'GitlabTest_Build' - fill_in 'Username', with: 'user' - fill_in 'Password', with: 'verySecret' - click_button 'Save' - end - - step 'I should see JetBrains TeamCity CI service settings saved' do - find_field('Teamcity url').value.should == 'http://teamcity.example.com' - find_field('Build type').value.should == 'GitlabTest_Build' - find_field('Username').value.should == 'user' - end -end diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb deleted file mode 100644 index 343aeb53b11..00000000000 --- a/features/steps/project/snippets.rb +++ /dev/null @@ -1,95 +0,0 @@ -class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedNote - include SharedPaths - - step 'project "Shop" have "Snippet one" snippet' do - create(:project_snippet, - title: "Snippet one", - content: "Test content", - file_name: "snippet.rb", - project: project, - author: project.users.first) - end - - step 'project "Shop" have no "Snippet two" snippet' do - create(:snippet, - title: "Snippet two", - content: "Test content", - file_name: "snippet.rb", - author: project.users.first) - end - - step 'I click link "New Snippet"' do - click_link "Add new snippet" - end - - step 'I click link "Snippet one"' do - click_link "Snippet one" - end - - step 'I should see "Snippet one" in snippets' do - page.should have_content "Snippet one" - end - - step 'I should not see "Snippet two" in snippets' do - page.should_not have_content "Snippet two" - end - - step 'I should not see "Snippet one" in snippets' do - page.should_not have_content "Snippet one" - end - - step 'I click link "Edit"' do - within ".file-title" do - click_link "Edit" - end - end - - step 'I click link "Remove Snippet"' do - click_link "remove" - end - - step 'I submit new snippet "Snippet three"' do - fill_in "project_snippet_title", :with => "Snippet three" - fill_in "project_snippet_file_name", :with => "my_snippet.rb" - within('.file-editor') do - find(:xpath, "//input[@id='project_snippet_content']").set 'Content of snippet three' - end - click_button "Create snippet" - end - - step 'I should see snippet "Snippet three"' do - page.should have_content "Snippet three" - page.should have_content "Content of snippet three" - end - - step 'I submit new title "Snippet new title"' do - fill_in "project_snippet_title", :with => "Snippet new title" - click_button "Save" - end - - step 'I should see "Snippet new title"' do - page.should have_content "Snippet new title" - end - - step 'I leave a comment like "Good snippet!"' do - within('.js-main-target-form') do - fill_in "note_note", with: "Good snippet!" - click_button "Add Comment" - end - end - - step 'I should see comment "Good snippet!"' do - page.should have_content "Good snippet!" - end - - step 'I visit snippet page "Snippet one"' do - visit namespace_project_snippet_path(project.namespace, project, project_snippet) - end - - def project_snippet - @project_snippet ||= ProjectSnippet.find_by!(title: "Snippet one") - end -end diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb deleted file mode 100644 index caf6c73ee06..00000000000 --- a/features/steps/project/source/browse_files.rb +++ /dev/null @@ -1,218 +0,0 @@ -class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - include RepoHelpers - - step 'I should see files from repository' do - page.should have_content "VERSION" - page.should have_content ".gitignore" - page.should have_content "LICENSE" - end - - step 'I should see files from repository for "6d39438"' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "6d39438") - page.should have_content ".gitignore" - page.should have_content "LICENSE" - end - - step 'I see the ".gitignore"' do - page.should have_content '.gitignore' - end - - step 'I don\'t see the ".gitignore"' do - page.should_not have_content '.gitignore' - end - - step 'I click on ".gitignore" file in repo' do - click_link ".gitignore" - end - - step 'I should see its content' do - page.should have_content old_gitignore_content - end - - step 'I should see its new content' do - page.should have_content new_gitignore_content - end - - step 'I click link "Raw"' do - click_link 'Raw' - end - - step 'I should see raw file content' do - source.should == sample_blob.data - end - - step 'I click button "Edit"' do - click_link 'Edit' - end - - step 'I cannot see the edit button' do - page.should_not have_link 'edit' - end - - step 'The edit button is disabled' do - page.should have_css '.disabled', text: 'Edit' - end - - step 'I can edit code' do - set_new_content - evaluate_script('blob.editor.getValue()').should == new_gitignore_content - end - - step 'I edit code' do - set_new_content - end - - step 'I fill the new file name' do - fill_in :file_name, with: new_file_name - end - - step 'I fill the new branch name' do - fill_in :new_branch, with: 'new_branch_name' - end - - step 'I fill the new file name with an illegal name' do - fill_in :file_name, with: 'Spaces Not Allowed' - end - - step 'I fill the commit message' do - fill_in :commit_message, with: 'Not yet a commit message.' - end - - step 'I click link "Diff"' do - click_link 'Preview changes' - end - - step 'I click on "Commit Changes"' do - click_button 'Commit Changes' - end - - step 'I click on "Remove"' do - click_button 'Remove' - end - - step 'I click on "Remove file"' do - click_button 'Remove file' - end - - step 'I see diff' do - page.should have_css '.line_holder.new' - end - - step 'I click on "new file" link in repo' do - click_link 'new-file-link' - end - - step 'I can see new file page' do - page.should have_content "New file" - page.should have_content "Commit message" - end - - step 'I click on files directory' do - click_link 'files' - end - - step 'I click on History link' do - click_link 'History' - end - - step 'I see Browse dir link' do - page.should have_link 'Browse Dir »' - page.should_not have_link 'Browse Code »' - end - - step 'I click on readme file' do - within '.tree-table' do - click_link 'README.md' - end - end - - step 'I see Browse file link' do - page.should have_link 'Browse File »' - page.should_not have_link 'Browse Code »' - end - - step 'I see Browse code link' do - page.should have_link 'Browse Code »' - page.should_not have_link 'Browse File »' - page.should_not have_link 'Browse Dir »' - end - - step 'I click on Permalink' do - click_link 'Permalink' - end - - step 'I am redirected to the files URL' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, 'master') - end - - step 'I am redirected to the ".gitignore"' do - expect(current_path).to eq(namespace_project_blob_path(@project.namespace, @project, 'master/.gitignore')) - end - - step 'I am redirected to the ".gitignore" on new branch' do - expect(current_path).to eq(namespace_project_blob_path(@project.namespace, @project, 'new_branch_name/.gitignore')) - end - - step 'I am redirected to the permalink URL' do - expect(current_path).to( - eq(namespace_project_blob_path(@project.namespace, @project, - @project.repository.commit.sha + - '/.gitignore')) - ) - end - - step 'I am redirected to the new file' do - expect(current_path).to eq(namespace_project_blob_path( - @project.namespace, @project, 'master/' + new_file_name)) - end - - step 'I am redirected to the new file on new branch' do - expect(current_path).to eq(namespace_project_blob_path( - @project.namespace, @project, 'new_branch_name/' + new_file_name)) - end - - step "I don't see the permalink link" do - expect(page).not_to have_link('permalink') - end - - step 'I see a commit error message' do - expect(page).to have_content('Your changes could not be committed') - end - - step 'I create bare repo' do - click_link 'Create empty bare repository' - end - - step 'I click on "add a file" link' do - click_link 'add a file' - - # Remove pre-receive hook so we can push without auth - FileUtils.rm_f(File.join(@project.repository.path, 'hooks', 'pre-receive')) - end - - private - - def set_new_content - execute_script("blob.editor.setValue('#{new_gitignore_content}')") - end - - # Content of the gitignore file on the seed repository. - def old_gitignore_content - '*.rbc' - end - - # Constant value that differs from the content - # of the gitignore of the seed repository. - def new_gitignore_content - old_gitignore_content + 'a' - end - - # Constant value that is a valid filename and - # not a filename present at root of the seed repository. - def new_file_name - 'not_a_file.md' - end -end diff --git a/features/steps/project/source/git_blame.rb b/features/steps/project/source/git_blame.rb deleted file mode 100644 index e29a816c51b..00000000000 --- a/features/steps/project/source/git_blame.rb +++ /dev/null @@ -1,19 +0,0 @@ -class Spinach::Features::ProjectSourceGitBlame < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'I click on ".gitignore" file in repo' do - click_link ".gitignore" - end - - step 'I click Blame button' do - click_link 'Blame' - end - - step 'I should see git file blame' do - page.should have_content "*.rb" - page.should have_content "Dmitriy Zaporozhets" - page.should have_content "Initial commit" - end -end diff --git a/features/steps/project/source/markdown_render.rb b/features/steps/project/source/markdown_render.rb deleted file mode 100644 index 7961fdedad8..00000000000 --- a/features/steps/project/source/markdown_render.rb +++ /dev/null @@ -1,288 +0,0 @@ -# If you need to modify the existing seed repository for your tests, -# it is recommended that you make the changes on the `markdown` branch of the seed project repository, -# which should only be used by tests in this file. See `/spec/factories.rb#project` for more info. -class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedMarkdown - - step 'I own project "Delta"' do - @project = Project.find_by(name: "Delta") - @project ||= create(:project, name: "Delta", namespace: @user.namespace) - @project.team << [@user, :master] - end - - step 'I should see files from repository in markdown' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown") - page.should have_content "README.md" - page.should have_content "CHANGELOG" - end - - step 'I should see rendered README which contains correct links' do - page.should have_content "Welcome to GitLab GitLab is a free project and repository management application" - page.should have_link "GitLab API doc" - page.should have_link "GitLab API website" - page.should have_link "Rake tasks" - page.should have_link "backup and restore procedure" - page.should have_link "GitLab API doc directory" - page.should have_link "Maintenance" - end - - step 'I click on Gitlab API in README' do - click_link "GitLab API doc" - end - - step 'I should see correct document rendered' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") - page.should have_content "All API requests require authentication" - end - - step 'I click on Rake tasks in README' do - click_link "Rake tasks" - end - - step 'I should see correct directory rendered' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks") - page.should have_content "backup_restore.md" - page.should have_content "maintenance.md" - end - - step 'I click on GitLab API doc directory in README' do - click_link "GitLab API doc directory" - end - - step 'I should see correct doc/api directory rendered' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") - page.should have_content "README.md" - page.should have_content "users.md" - end - - step 'I click on Maintenance in README' do - click_link "Maintenance" - end - - step 'I should see correct maintenance file rendered' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/raketasks/maintenance.md") - page.should have_content "bundle exec rake gitlab:env:info RAILS_ENV=production" - end - - step 'I click on link "empty" in the README' do - within('.readme-holder') do - click_link "empty" - end - end - - step 'I click on link "id" in the README' do - within('.readme-holder') do - click_link "#id" - end - end - - step 'I navigate to the doc/api/README' do - within '.tree-table' do - click_link "doc" - end - - within '.tree-table' do - click_link "api" - end - - within '.tree-table' do - click_link "README.md" - end - end - - step 'I see correct file rendered' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") - page.should have_content "Contents" - page.should have_link "Users" - page.should have_link "Rake tasks" - end - - step 'I click on users in doc/api/README' do - click_link "Users" - end - - step 'I should see the correct document file' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") - page.should have_content "Get a list of users." - end - - step 'I click on raketasks in doc/api/README' do - click_link "Rake tasks" - end - - # Markdown branch - - When 'I visit markdown branch' do - visit namespace_project_tree_path(@project.namespace, @project, "markdown") - end - - When 'I visit markdown branch "README.md" blob' do - visit namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") - end - - When 'I visit markdown branch "d" tree' do - visit namespace_project_tree_path(@project.namespace, @project, "markdown/d") - end - - When 'I visit markdown branch "d/README.md" blob' do - visit namespace_project_blob_path(@project.namespace, @project, "markdown/d/README.md") - end - - step 'I should see files from repository in markdown branch' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown") - page.should have_content "README.md" - page.should have_content "CHANGELOG" - end - - step 'I see correct file rendered in markdown branch' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") - page.should have_content "Contents" - page.should have_link "Users" - page.should have_link "Rake tasks" - end - - step 'I should see correct document rendered for markdown branch' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") - page.should have_content "All API requests require authentication" - end - - step 'I should see correct directory rendered for markdown branch' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks") - page.should have_content "backup_restore.md" - page.should have_content "maintenance.md" - end - - step 'I should see the users document file in markdown branch' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") - page.should have_content "Get a list of users." - end - - # Expected link contents - - step 'The link with text "empty" should have url "tree/markdown"' do - find('a', text: /^empty$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown") - end - - step 'The link with text "empty" should have url "blob/markdown/README.md"' do - find('a', text: /^empty$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") - end - - step 'The link with text "empty" should have url "tree/markdown/d"' do - find('a', text: /^empty$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown/d") - end - - step 'The link with text "empty" should have '\ - 'url "blob/markdown/d/README.md"' do - find('a', text: /^empty$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/d/README.md") - end - - step 'The link with text "ID" should have url "tree/markdownID"' do - find('a', text: /^#id$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown") + '#id' - end - - step 'The link with text "/ID" should have url "tree/markdownID"' do - find('a', text: /^\/#id$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown") + '#id' - end - - step 'The link with text "README.mdID" '\ - 'should have url "blob/markdown/README.mdID"' do - find('a', text: /^README.md#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id' - end - - step 'The link with text "d/README.mdID" should have '\ - 'url "blob/markdown/d/README.mdID"' do - find('a', text: /^d\/README.md#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "d/markdown/README.md") + '#id' - end - - step 'The link with text "ID" should have url "blob/markdown/README.mdID"' do - find('a', text: /^#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id' - end - - step 'The link with text "/ID" should have url "blob/markdown/README.mdID"' do - find('a', text: /^\/#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id' - end - - # Wiki - - step 'I go to wiki page' do - click_link "Wiki" - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home") - end - - step 'I add various links to the wiki page' do - fill_in "wiki[content]", with: "[test](test)\n[GitLab API doc](api)\n[Rake tasks](raketasks)\n" - fill_in "wiki[message]", with: "Adding links to wiki" - click_button "Create page" - end - - step 'Wiki page should have added links' do - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home") - page.should have_content "test GitLab API doc Rake tasks" - end - - step 'I add a header to the wiki page' do - fill_in "wiki[content]", with: "# Wiki header\n" - fill_in "wiki[message]", with: "Add header to wiki" - click_button "Create page" - end - - step 'Wiki header should have correct id and link' do - header_should_have_correct_id_and_link(1, 'Wiki header', 'wiki-header') - end - - step 'I click on test link' do - click_link "test" - end - - step 'I see new wiki page named test' do - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "test") - page.should have_content "Editing" - end - - When 'I go back to wiki page home' do - visit namespace_project_wiki_path(@project.namespace, @project, "home") - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home") - end - - step 'I click on GitLab API doc link' do - click_link "GitLab API" - end - - step 'I see Gitlab API document' do - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "api") - page.should have_content "Editing" - end - - step 'I click on Rake tasks link' do - click_link "Rake tasks" - end - - step 'I see Rake tasks directory' do - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "raketasks") - page.should have_content "Editing" - end - - step 'I go directory which contains README file' do - visit namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") - end - - step 'I click on a relative link in README' do - click_link "Users" - end - - step 'I should see the correct markdown' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") - page.should have_content "List users" - end - - step 'Header "Application details" should have correct id and link' do - header_should_have_correct_id_and_link(2, 'Application details', 'application-details') - end - - step 'Header "GitLab API" should have correct id and link' do - header_should_have_correct_id_and_link(1, 'GitLab API', 'gitlab-api') - end -end diff --git a/features/steps/project/source/multiselect_blob.rb b/features/steps/project/source/multiselect_blob.rb deleted file mode 100644 index b749ba49371..00000000000 --- a/features/steps/project/source/multiselect_blob.rb +++ /dev/null @@ -1,58 +0,0 @@ -class Spinach::Features::ProjectSourceMultiselectBlob < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - class << self - def click_line_steps(*line_numbers) - line_numbers.each do |line_number| - step "I click line #{line_number} in file" do - find("#L#{line_number}").click - end - - step "I shift-click line #{line_number} in file" do - script = "$('#L#{line_number}').trigger($.Event('click', { shiftKey: true }));" - execute_script(script) - end - end - end - - def check_state_steps(*ranges) - ranges.each do |range| - fragment = range.kind_of?(Array) ? "L#{range.first}-#{range.last}" : "L#{range}" - pluralization = range.kind_of?(Array) ? "s" : "" - - step "I should see \"#{fragment}\" as URI fragment" do - URI.parse(current_url).fragment.should == fragment - end - - step "I should see line#{pluralization} #{fragment[1..-1]} highlighted" do - ids = Array(range).map { |n| "LC#{n}" } - extra = false - - highlighted = all("#tree-content-holder .highlight .line.hll") - highlighted.each do |element| - extra ||= ids.delete(element[:id]).nil? - end - - extra.should be_false and ids.should be_empty - end - end - end - end - - click_line_steps *Array(1..5) - check_state_steps *Array(1..5), Array(1..2), Array(1..3), Array(1..4), Array(1..5), Array(3..5) - - step 'I go back in history' do - go_back - end - - step 'I go forward in history' do - go_forward - end - - step 'I click on ".gitignore" file in repo' do - click_link ".gitignore" - end -end diff --git a/features/steps/project/source/search_code.rb b/features/steps/project/source/search_code.rb deleted file mode 100644 index 9c2864cc936..00000000000 --- a/features/steps/project/source/search_code.rb +++ /dev/null @@ -1,19 +0,0 @@ -class Spinach::Features::ProjectSourceSearchCode < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'I search for term "coffee"' do - fill_in "search", with: "coffee" - click_button "Go" - end - - step 'I should see files from repository containing "coffee"' do - page.should have_content 'coffee' - page.should have_content 'CONTRIBUTING.md' - end - - step 'I should see empty result' do - page.should have_content "We couldn't find any matching" - end -end diff --git a/features/steps/project/star.rb b/features/steps/project/star.rb deleted file mode 100644 index 50cdfd73c34..00000000000 --- a/features/steps/project/star.rb +++ /dev/null @@ -1,37 +0,0 @@ -class Spinach::Features::ProjectStar < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - include SharedUser - - step "The project has no stars" do - page.should_not have_content '.star-buttons' - end - - step "The project has 0 stars" do - has_n_stars(0) - end - - step "The project has 1 star" do - has_n_stars(1) - end - - step "The project has 2 stars" do - has_n_stars(2) - end - - # Requires @javascript - step "I click on the star toggle button" do - find(".star-btn", visible: true).click - end - - step 'I redirected to sign in page' do - current_path.should == new_user_session_path - end - - protected - - def has_n_stars(n) - expect(page).to have_css(".star-btn .count", text: n, visible: true) - end -end diff --git a/features/steps/project/team_management.rb b/features/steps/project/team_management.rb deleted file mode 100644 index e95621071c4..00000000000 --- a/features/steps/project/team_management.rb +++ /dev/null @@ -1,130 +0,0 @@ -class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - include Select2Helper - - step 'I should be able to see myself in team' do - page.should have_content(@user.name) - page.should have_content(@user.username) - end - - step 'I should see "Sam" in team list' do - user = User.find_by(name: "Sam") - page.should have_content(user.name) - page.should have_content(user.username) - end - - step 'I click link "Add members"' do - find(:css, 'button.btn-new').click - end - - step 'I select "Mike" as "Reporter"' do - user = User.find_by(name: "Mike") - - within ".users-project-form" do - select2(user.id, from: "#user_ids", multiple: true) - select "Reporter", from: "access_level" - end - click_button "Add users to project" - end - - step 'I should see "Mike" in team list as "Reporter"' do - within ".access-reporter" do - page.should have_content('Mike') - end - end - - step 'I select "sjobs@apple.com" as "Reporter"' do - within ".users-project-form" do - select2("sjobs@apple.com", from: "#user_ids", multiple: true) - select "Reporter", from: "access_level" - end - click_button "Add users to project" - end - - step 'I should see "sjobs@apple.com" in team list as invited "Reporter"' do - within ".access-reporter" do - page.should have_content('sjobs@apple.com') - page.should have_content('invited') - page.should have_content('Reporter') - end - end - - step 'I should see "Sam" in team list as "Developer"' do - within ".access-developer" do - page.should have_content('Sam') - end - end - - step 'I change "Sam" role to "Reporter"' do - project = Project.find_by(name: "Shop") - user = User.find_by(name: 'Sam') - project_member = project.project_members.find_by(user_id: user.id) - within "#project_member_#{project_member.id}" do - click_button "Edit access level" - select "Reporter", from: "project_member_access_level" - click_button "Save" - end - end - - step 'I should see "Sam" in team list as "Reporter"' do - within ".access-reporter" do - page.should have_content('Sam') - end - end - - step 'I click link "Remove from team"' do - click_link "Remove from team" - end - - step 'I should not see "Sam" in team list' do - user = User.find_by(name: "Sam") - page.should_not have_content(user.name) - page.should_not have_content(user.username) - end - - step 'gitlab user "Mike"' do - create(:user, name: "Mike") - end - - step 'gitlab user "Sam"' do - create(:user, name: "Sam") - end - - step '"Sam" is "Shop" developer' do - user = User.find_by(name: "Sam") - project = Project.find_by(name: "Shop") - project.team << [user, :developer] - end - - step 'I own project "Website"' do - @project = create(:empty_project, name: "Website", namespace: @user.namespace) - @project.team << [@user, :master] - end - - step '"Mike" is "Website" reporter' do - user = User.find_by(name: "Mike") - project = Project.find_by(name: "Website") - project.team << [user, :reporter] - end - - step 'I click link "Import team from another project"' do - click_link "Import members from another project" - end - - When 'I submit "Website" project for import team' do - project = Project.find_by(name: "Website") - select project.name_with_namespace, from: 'source_project_id' - click_button 'Import' - end - - step 'I click cancel link for "Sam"' do - project = Project.find_by(name: "Shop") - user = User.find_by(name: 'Sam') - project_member = project.project_members.find_by(user_id: user.id) - within "#project_member_#{project_member.id}" do - click_link('Remove user from team') - end - end -end diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb deleted file mode 100644 index bb93e582a1f..00000000000 --- a/features/steps/project/wiki.rb +++ /dev/null @@ -1,165 +0,0 @@ -class Spinach::Features::ProjectWiki < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedNote - include SharedPaths - include WikiHelper - - step 'I click on the Cancel button' do - within(:css, ".form-actions") do - click_on "Cancel" - end - end - - step 'I should be redirected back to the Edit Home Wiki page' do - current_path.should == namespace_project_wiki_path(project.namespace, project, :home) - end - - step 'I create the Wiki Home page' do - fill_in "wiki_content", with: '[link test](test)' - click_on "Create page" - end - - step 'I should see the newly created wiki page' do - page.should have_content "Home" - page.should have_content "link test" - - click_link "link test" - page.should have_content "Editing" - end - - step 'I have an existing Wiki page' do - wiki.create_page("existing", "content", :markdown, "first commit") - @page = wiki.find_page("existing") - end - - step 'I browse to that Wiki page' do - visit namespace_project_wiki_path(project.namespace, project, @page) - end - - step 'I click on the Edit button' do - click_on "Edit" - end - - step 'I change the content' do - fill_in "Content", with: 'Updated Wiki Content' - click_on "Save changes" - end - - step 'I should see the updated content' do - page.should have_content "Updated Wiki Content" - end - - step 'I should be redirected back to that Wiki page' do - current_path.should == namespace_project_wiki_path(project.namespace, project, @page) - end - - step 'That page has two revisions' do - @page.update("new content", :markdown, "second commit") - end - - step 'I click the History button' do - click_on "History" - end - - step 'I should see both revisions' do - page.should have_content current_user.name - page.should have_content "first commit" - page.should have_content "second commit" - end - - step 'I click on the "Delete this page" button' do - click_on "Delete this page" - end - - step 'The page should be deleted' do - page.should have_content "Page was successfully deleted" - end - - step 'I click on the "Pages" button' do - click_on "Pages" - end - - step 'I should see the existing page in the pages list' do - page.should have_content current_user.name - page.should have_content @page.title - end - - step 'I have an existing Wiki page with images linked on page' do - wiki.create_page("pictures", "Look at this [image](image.jpg)\n\n ![image](image.jpg)", :markdown, "first commit") - @wiki_page = wiki.find_page("pictures") - end - - step 'I browse to wiki page with images' do - visit namespace_project_wiki_path(project.namespace, project, @wiki_page) - end - - step 'I click on existing image link' do - file = Gollum::File.new(wiki.wiki) - Gollum::Wiki.any_instance.stub(:file).with("image.jpg", "master", true).and_return(file) - Gollum::File.any_instance.stub(:mime_type).and_return("image/jpeg") - page.should have_link('image', href: "image.jpg") - click_on "image" - end - - step 'I should see the image from wiki repo' do - current_path.should match('wikis/image.jpg') - page.should_not have_xpath('/html') # Page should render the image which means there is no html involved - Gollum::Wiki.any_instance.unstub(:file) - Gollum::File.any_instance.unstub(:mime_type) - end - - step 'Image should be shown on the page' do - page.should have_xpath("//img[@src=\"image.jpg\"]") - end - - step 'I click on image link' do - page.should have_link('image', href: "image.jpg") - click_on "image" - end - - step 'I should see the new wiki page form' do - current_path.should match('wikis/image.jpg') - page.should have_content('New Wiki Page') - page.should have_content('Editing - image.jpg') - end - - step 'I create a New page with paths' do - click_on 'New Page' - fill_in 'Page slug', with: 'one/two/three' - click_on 'Build' - fill_in "wiki_content", with: 'wiki content' - click_on "Create page" - current_path.should include 'one/two/three' - end - - step 'I should see non-escaped link in the pages list' do - page.should have_xpath("//a[@href='/#{project.path_with_namespace}/wikis/one/two/three']") - end - - step 'I edit the Wiki page with a path' do - click_on 'three' - click_on 'Edit' - end - - step 'I should see a non-escaped path' do - current_path.should include 'one/two/three' - end - - step 'I should see the Editing page' do - page.should have_content('Editing') - end - - step 'I view the page history of a Wiki page that has a path' do - click_on 'three' - click_on 'Page History' - end - - step 'I should see the page history' do - page.should have_content('History for') - end - - def wiki - @project_wiki = ProjectWiki.new(project, current_user) - end -end diff --git a/features/steps/search.rb b/features/steps/search.rb deleted file mode 100644 index 6f0e038c4d6..00000000000 --- a/features/steps/search.rb +++ /dev/null @@ -1,69 +0,0 @@ -class Spinach::Features::Search < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I search for "Sho"' do - fill_in "dashboard_search", with: "Sho" - click_button "Search" - end - - step 'I search for "Foo"' do - fill_in "dashboard_search", with: "Foo" - click_button "Search" - end - - step 'I search for "rspec"' do - fill_in "dashboard_search", with: "rspec" - click_button "Search" - end - - step 'I click "Issues" link' do - within '.search-filter' do - click_link 'Issues' - end - end - - step 'I click project "Shop" link' do - within '.project-filter' do - click_link project.name_with_namespace - end - end - - step 'I click "Merge requests" link' do - within '.search-filter' do - click_link 'Merge requests' - end - end - - step 'I should see "Shop" project link' do - page.should have_link "Shop" - end - - step 'I should see code results for project "Shop"' do - page.should have_content 'Update capybara, rspec-rails, poltergeist to recent versions' - end - - step 'I search for "Contibuting"' do - fill_in "dashboard_search", with: "Contibuting" - click_button "Search" - end - - step 'project has issues' do - create(:issue, title: "Foo", project: project) - create(:issue, title: "Bar", project: project) - end - - step 'project has merge requests' do - create(:merge_request, title: "Foo", source_project: project, target_project: project) - create(:merge_request, :simple, title: "Bar", source_project: project, target_project: project) - end - - step 'I should see "Foo" link in the search results' do - find(:css, '.search-results').should have_link 'Foo' - end - - step 'I should not see "Bar" link in the search results' do - find(:css, '.search-results').should_not have_link 'Bar' - end -end diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb deleted file mode 100644 index 9beb688bd16..00000000000 --- a/features/steps/shared/active_tab.rb +++ /dev/null @@ -1,47 +0,0 @@ -module SharedActiveTab - include Spinach::DSL - - def ensure_active_main_tab(content) - find('.nav-sidebar > li.active').should have_content(content) - end - - def ensure_active_sub_tab(content) - find('div.content ul.nav-tabs li.active').should have_content(content) - end - - def ensure_active_sub_nav(content) - find('.sidebar-subnav > li.active').should have_content(content) - end - - step 'no other main tabs should be active' do - page.should have_selector('.nav-sidebar > li.active', count: 1) - end - - step 'no other sub tabs should be active' do - page.should have_selector('div.content ul.nav-tabs li.active', count: 1) - end - - step 'no other sub navs should be active' do - page.should have_selector('.sidebar-subnav > li.active', count: 1) - end - - step 'the active main tab should be Home' do - ensure_active_main_tab('Your Projects') - end - - step 'the active main tab should be Projects' do - ensure_active_main_tab('Projects') - end - - step 'the active main tab should be Issues' do - ensure_active_main_tab('Issues') - end - - step 'the active main tab should be Merge Requests' do - ensure_active_main_tab('Merge Requests') - end - - step 'the active main tab should be Help' do - ensure_active_main_tab('Help') - end -end diff --git a/features/steps/shared/admin.rb b/features/steps/shared/admin.rb deleted file mode 100644 index b6072995677..00000000000 --- a/features/steps/shared/admin.rb +++ /dev/null @@ -1,12 +0,0 @@ -module SharedAdmin - include Spinach::DSL - - step 'there are projects in system' do - 2.times { create(:project) } - end - - step 'system has users' do - 2.times { create(:user) } - end -end - diff --git a/features/steps/shared/authentication.rb b/features/steps/shared/authentication.rb deleted file mode 100644 index ac8a3df6bb9..00000000000 --- a/features/steps/shared/authentication.rb +++ /dev/null @@ -1,34 +0,0 @@ -require Rails.root.join('spec', 'support', 'login_helpers') - -module SharedAuthentication - include Spinach::DSL - include LoginHelpers - - step 'I sign in as a user' do - login_as :user - end - - step 'I sign in as an admin' do - login_as :admin - end - - step 'I sign in as "John Doe"' do - login_with(user_exists("John Doe")) - end - - step 'I sign in as "Mary Jane"' do - login_with(user_exists("Mary Jane")) - end - - step 'I should be redirected to sign in page' do - current_path.should == new_user_session_path - end - - step "I logout" do - logout - end - - def current_user - @user || User.first - end -end diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb deleted file mode 100644 index 510e0f0f938..00000000000 --- a/features/steps/shared/diff_note.rb +++ /dev/null @@ -1,167 +0,0 @@ -module SharedDiffNote - include Spinach::DSL - include RepoHelpers - - step 'I cancel the diff comment' do - within(diff_file_selector) do - find(".js-close-discussion-note-form").click - end - end - - step 'I delete a diff comment' do - find('.note').hover - find(".js-note-delete").click - end - - step 'I haven\'t written any diff comment text' do - within(diff_file_selector) do - fill_in "note[note]", with: "" - end - end - - step 'I leave a diff comment like "Typo, please fix"' do - click_diff_line(sample_commit.line_code) - within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do - fill_in "note[note]", with: "Typo, please fix" - find(".js-comment-button").trigger("click") - sleep 0.05 - end - end - - step 'I preview a diff comment text like "Should fix it :smile:"' do - click_diff_line(sample_commit.line_code) - within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do - fill_in "note[note]", with: "Should fix it :smile:" - find('.js-md-preview-button').click - end - end - - step 'I preview another diff comment text like "DRY this up"' do - click_diff_line(sample_commit.del_line_code) - - within("#{diff_file_selector} form[rel$='#{sample_commit.del_line_code}']") do - fill_in "note[note]", with: "DRY this up" - find('.js-md-preview-button').click - end - end - - step 'I open a diff comment form' do - click_diff_line(sample_commit.line_code) - end - - step 'I open another diff comment form' do - click_diff_line(sample_commit.del_line_code) - end - - step 'I write a diff comment like ":-1: I don\'t like this"' do - within(diff_file_selector) do - fill_in "note[note]", with: ":-1: I don\'t like this" - end - end - - step 'I submit the diff comment' do - within(diff_file_selector) do - click_button("Add Comment") - end - end - - step 'I should not see the diff comment form' do - within(diff_file_selector) do - page.should_not have_css("form.new_note") - end - end - - step 'The diff comment preview tab should say there is nothing to do' do - within(diff_file_selector) do - find('.js-md-preview-button').click - expect(find('.js-md-preview')).to have_content('Nothing to preview.') - end - end - - step 'I should not see the diff comment text field' do - within(diff_file_selector) do - expect(find('.js-note-text')).not_to be_visible - end - end - - step 'I should only see one diff form' do - within(diff_file_selector) do - page.should have_css("form.new_note", count: 1) - end - end - - step 'I should see a diff comment form with ":-1: I don\'t like this"' do - within(diff_file_selector) do - page.should have_field("note[note]", with: ":-1: I don\'t like this") - end - end - - step 'I should see a diff comment saying "Typo, please fix"' do - within("#{diff_file_selector} .note") do - page.should have_content("Typo, please fix") - end - end - - step 'I should see a discussion reply button' do - within(diff_file_selector) do - page.should have_button('Reply') - end - end - - step 'I should see a temporary diff comment form' do - within(diff_file_selector) do - page.should have_css(".js-temp-notes-holder form.new_note") - end - end - - step 'I should see add a diff comment button' do - page.should have_css('.js-add-diff-note-button', visible: true) - end - - step 'I should see an empty diff comment form' do - within(diff_file_selector) do - page.should have_field("note[note]", with: "") - end - end - - step 'I should see the cancel comment button' do - within("#{diff_file_selector} form") do - page.should have_css(".js-close-discussion-note-form", text: "Cancel") - end - end - - step 'I should see the diff comment preview' do - within("#{diff_file_selector} form") do - expect(page).to have_css('.js-md-preview', visible: true) - end - end - - step 'I should see the diff comment write tab' do - within(diff_file_selector) do - expect(page).to have_css('.js-md-write-button', visible: true) - end - end - - step 'The diff comment preview tab should display rendered Markdown' do - within(diff_file_selector) do - find('.js-md-preview-button').click - expect(find('.js-md-preview')).to have_css('img.emoji', visible: true) - end - end - - step 'I should see two separate previews' do - within(diff_file_selector) do - expect(page).to have_css('.js-md-preview', visible: true, count: 2) - expect(page).to have_content('Should fix it') - expect(page).to have_content('DRY this up') - end - end - - def diff_file_selector - ".diff-file:nth-of-type(1)" - end - - def click_diff_line(code) - find("button[data-line-code='#{code}']").click - end -end diff --git a/features/steps/shared/group.rb b/features/steps/shared/group.rb deleted file mode 100644 index 1b225dd61a6..00000000000 --- a/features/steps/shared/group.rb +++ /dev/null @@ -1,44 +0,0 @@ -module SharedGroup - include Spinach::DSL - - step '"John Doe" is owner of group "Owned"' do - is_member_of("John Doe", "Owned", Gitlab::Access::OWNER) - end - - step '"John Doe" is guest of group "Guest"' do - is_member_of("John Doe", "Guest", Gitlab::Access::GUEST) - end - - step '"Mary Jane" is owner of group "Owned"' do - is_member_of("Mary Jane", "Owned", Gitlab::Access::OWNER) - end - - step '"Mary Jane" is guest of group "Owned"' do - is_member_of("Mary Jane", "Owned", Gitlab::Access::GUEST) - end - - step '"Mary Jane" is guest of group "Guest"' do - is_member_of("Mary Jane", "Guest", Gitlab::Access::GUEST) - end - - step 'I should see group "TestGroup"' do - page.should have_content "TestGroup" - end - - step 'I should not see group "TestGroup"' do - page.should_not have_content "TestGroup" - end - - protected - - def is_member_of(username, groupname, role) - @project_count ||= 0 - user = User.find_by(name: username) || create(:user, name: username) - group = Group.find_by(name: groupname) || create(:group, name: groupname) - group.add_user(user, role) - project ||= create(:project, namespace: group, path: "project#{@project_count}") - event ||= create(:closed_issue_event, project: project) - project.team << [user, :master] - @project_count += 1 - end -end diff --git a/features/steps/shared/issuable.rb b/features/steps/shared/issuable.rb deleted file mode 100644 index 41db2612f26..00000000000 --- a/features/steps/shared/issuable.rb +++ /dev/null @@ -1,15 +0,0 @@ -module SharedIssuable - include Spinach::DSL - - def edit_issuable - find(:css, '.issuable-edit').click - end - - step 'I click link "Edit" for the merge request' do - edit_issuable - end - - step 'I click link "Edit" for the issue' do - edit_issuable - end -end diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb deleted file mode 100644 index e71700880cd..00000000000 --- a/features/steps/shared/markdown.rb +++ /dev/null @@ -1,102 +0,0 @@ -module SharedMarkdown - include Spinach::DSL - - def header_should_have_correct_id_and_link(level, text, id, parent = ".wiki") - find(:css, "#{parent} h#{level}##{id}").text.should == text - find(:css, "#{parent} h#{level}##{id} > :last-child")[:href].should =~ /##{id}$/ - end - - def create_taskable(type, title) - desc_text = <<EOT.gsub(/^ {6}/, '') - * [ ] Task 1 - * [x] Task 2 -EOT - - case type - when :issue, :closed_issue - options = { project: project } - when :merge_request - options = { source_project: project, target_project: project } - end - - create( - type, - options.merge(title: title, - author: project.users.first, - description: desc_text) - ) - end - - step 'Header "Description header" should have correct id and link' do - header_should_have_correct_id_and_link(1, 'Description header', 'description-header') - end - - step 'I should see task checkboxes in the description' do - expect(page).to have_selector( - 'div.description li.task-list-item input[type="checkbox"]' - ) - end - - step 'I should see the task status for the Taskable' do - expect(find(:css, 'span.task-status').text).to eq( - '2 tasks (1 done, 1 unfinished)' - ) - end - - step 'Task checkboxes should be enabled' do - expect(page).to have_selector( - 'div.description li.task-list-item input[type="checkbox"]:enabled' - ) - end - - step 'Task checkboxes should be disabled' do - expect(page).to have_selector( - 'div.description li.task-list-item input[type="checkbox"]:disabled' - ) - end - - step 'I should not see the Markdown preview' do - expect(find('.gfm-form .js-md-preview')).not_to be_visible - end - - step 'The Markdown preview tab should say there is nothing to do' do - within('.gfm-form') do - find('.js-md-preview-button').click - expect(find('.js-md-preview')).to have_content('Nothing to preview.') - end - end - - step 'I should not see the Markdown text field' do - expect(find('.gfm-form textarea')).not_to be_visible - end - - step 'I should see the Markdown write tab' do - expect(find('.gfm-form')).to have_css('.js-md-write-button', visible: true) - end - - step 'I should see the Markdown preview' do - expect(find('.gfm-form')).to have_css('.js-md-preview', visible: true) - end - - step 'The Markdown preview tab should display rendered Markdown' do - within('.gfm-form') do - find('.js-md-preview-button').click - expect(find('.js-md-preview')).to have_css('img.emoji', visible: true) - end - end - - step 'I write a description like ":+1: Nice"' do - find('.gfm-form').fill_in 'Description', with: ':+1: Nice' - end - - step 'I preview a description text like "Bug fixed :smile:"' do - within('.gfm-form') do - fill_in 'Description', with: 'Bug fixed :smile:' - find('.js-md-preview-button').click - end - end - - step 'I haven\'t written any description text' do - find('.gfm-form').fill_in 'Description', with: '' - end -end diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb deleted file mode 100644 index 583746d4475..00000000000 --- a/features/steps/shared/note.rb +++ /dev/null @@ -1,155 +0,0 @@ -module SharedNote - include Spinach::DSL - - step 'I delete a comment' do - find('.note').hover - find(".js-note-delete").click - end - - step 'I haven\'t written any comment text' do - within(".js-main-target-form") do - fill_in "note[note]", with: "" - end - end - - step 'I leave a comment like "XML attached"' do - within(".js-main-target-form") do - fill_in "note[note]", with: "XML attached" - click_button "Add Comment" - sleep 0.05 - end - end - - step 'I preview a comment text like "Bug fixed :smile:"' do - within(".js-main-target-form") do - fill_in "note[note]", with: "Bug fixed :smile:" - find('.js-md-preview-button').click - end - end - - step 'I submit the comment' do - within(".js-main-target-form") do - click_button "Add Comment" - end - end - - step 'I write a comment like ":+1: Nice"' do - within(".js-main-target-form") do - fill_in 'note[note]', with: ':+1: Nice' - end - end - - step 'I should not see a comment saying "XML attached"' do - page.should_not have_css(".note") - end - - step 'I should not see the cancel comment button' do - within(".js-main-target-form") do - should_not have_link("Cancel") - end - end - - step 'I should not see the comment preview' do - within(".js-main-target-form") do - expect(find('.js-md-preview')).not_to be_visible - end - end - - step 'The comment preview tab should say there is nothing to do' do - within(".js-main-target-form") do - find('.js-md-preview-button').click - expect(find('.js-md-preview')).to have_content('Nothing to preview.') - end - end - - step 'I should not see the comment text field' do - within(".js-main-target-form") do - expect(find('.js-note-text')).not_to be_visible - end - end - - step 'I should see a comment saying "XML attached"' do - within(".note") do - page.should have_content("XML attached") - end - end - - step 'I should see an empty comment text field' do - within(".js-main-target-form") do - page.should have_field("note[note]", with: "") - end - end - - step 'I should see the comment write tab' do - within(".js-main-target-form") do - expect(page).to have_css('.js-md-write-button', visible: true) - end - end - - step 'The comment preview tab should be display rendered Markdown' do - within(".js-main-target-form") do - find('.js-md-preview-button').click - expect(find('.js-md-preview')).to have_css('img.emoji', visible: true) - end - end - - step 'I should see the comment preview' do - within(".js-main-target-form") do - expect(page).to have_css('.js-md-preview', visible: true) - end - end - - step 'I should see comment "XML attached"' do - within(".note") do - page.should have_content("XML attached") - end - end - - # Markdown - - step 'I leave a comment with a header containing "Comment with a header"' do - within(".js-main-target-form") do - fill_in "note[note]", with: "# Comment with a header" - click_button "Add Comment" - sleep 0.05 - end - end - - step 'The comment with the header should not have an ID' do - within(".note-body > .note-text") do - page.should have_content("Comment with a header") - page.should_not have_css("#comment-with-a-header") - end - end - - step 'I leave a comment with task markdown' do - within('.js-main-target-form') do - fill_in 'note[note]', with: '* [x] Task item' - click_button 'Add Comment' - sleep 0.05 - end - end - - step 'I should not see task checkboxes in the comment' do - expect(page).not_to have_selector( - 'li.note div.timeline-content input[type="checkbox"]' - ) - end - - step 'I edit the last comment with a +1' do - find(".note").hover - find('.js-note-edit').click - - within(".current-note-edit-form") do - fill_in 'note[note]', with: '+1 Awesome!' - click_button 'Save Comment' - sleep 0.05 - end - end - - step 'I should see +1 in the description' do - within(".note") do - page.should have_content("+1 Awesome!") - end - end -end diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb deleted file mode 100644 index e3cf1b92cda..00000000000 --- a/features/steps/shared/paths.rb +++ /dev/null @@ -1,480 +0,0 @@ -module SharedPaths - include Spinach::DSL - include RepoHelpers - include DashboardHelper - - step 'I visit new project page' do - visit new_project_path - end - - # ---------------------------------------- - # User - # ---------------------------------------- - - step 'I visit user "John Doe" page' do - visit user_path("john_doe") - end - - # ---------------------------------------- - # Group - # ---------------------------------------- - - step 'I visit group "Owned" page' do - visit group_path(Group.find_by(name:"Owned")) - end - - step 'I visit group "Owned" issues page' do - visit issues_group_path(Group.find_by(name:"Owned")) - end - - step 'I visit group "Owned" merge requests page' do - visit merge_requests_group_path(Group.find_by(name:"Owned")) - end - - step 'I visit group "Owned" members page' do - visit group_group_members_path(Group.find_by(name:"Owned")) - end - - step 'I visit group "Owned" settings page' do - visit edit_group_path(Group.find_by(name:"Owned")) - end - - step 'I visit group "Guest" page' do - visit group_path(Group.find_by(name:"Guest")) - end - - step 'I visit group "Guest" issues page' do - visit issues_group_path(Group.find_by(name:"Guest")) - end - - step 'I visit group "Guest" merge requests page' do - visit merge_requests_group_path(Group.find_by(name:"Guest")) - end - - step 'I visit group "Guest" members page' do - visit group_group_members_path(Group.find_by(name:"Guest")) - end - - step 'I visit group "Guest" settings page' do - visit edit_group_path(Group.find_by(name:"Guest")) - end - - # ---------------------------------------- - # Dashboard - # ---------------------------------------- - - step 'I visit dashboard page' do - visit dashboard_path - end - - step 'I visit dashboard projects page' do - visit projects_dashboard_path - end - - step 'I visit dashboard issues page' do - visit assigned_issues_dashboard_path - end - - step 'I visit dashboard merge requests page' do - visit assigned_mrs_dashboard_path - end - - step 'I visit dashboard search page' do - visit search_path - end - - step 'I visit dashboard help page' do - visit help_path - end - - step 'I visit dashboard groups page' do - visit dashboard_groups_path - end - - step 'I should be redirected to the dashboard groups page' do - current_path.should == dashboard_groups_path - end - - step 'I visit dashboard starred projects page' do - visit starred_dashboard_projects_path - end - - # ---------------------------------------- - # Profile - # ---------------------------------------- - - step 'I visit profile page' do - visit profile_path - end - - step 'I visit profile applications page' do - visit applications_profile_path - end - - step 'I visit profile password page' do - visit edit_profile_password_path - end - - step 'I visit profile account page' do - visit profile_account_path - end - - step 'I visit profile SSH keys page' do - visit profile_keys_path - end - - step 'I visit profile design page' do - visit design_profile_path - end - - step 'I visit profile history page' do - visit history_profile_path - end - - # ---------------------------------------- - # Admin - # ---------------------------------------- - - step 'I visit admin page' do - visit admin_root_path - end - - step 'I visit admin projects page' do - visit admin_namespaces_projects_path - end - - step 'I visit admin users page' do - visit admin_users_path - end - - step 'I visit admin logs page' do - visit admin_logs_path - end - - step 'I visit admin messages page' do - visit admin_broadcast_messages_path - end - - step 'I visit admin hooks page' do - visit admin_hooks_path - end - - step 'I visit admin Resque page' do - visit admin_background_jobs_path - end - - step 'I visit admin groups page' do - visit admin_groups_path - end - - step 'I visit admin teams page' do - visit admin_teams_path - end - - step 'I visit admin settings page' do - visit admin_application_settings_path - end - - step 'I visit applications page' do - visit admin_applications_path - end - - # ---------------------------------------- - # Generic Project - # ---------------------------------------- - - step "I visit my project's home page" do - visit namespace_project_path(@project.namespace, @project) - end - - step "I visit my project's settings page" do - visit edit_namespace_project_path(@project.namespace, @project) - end - - step "I visit my project's files page" do - visit namespace_project_tree_path(@project.namespace, @project, root_ref) - end - - step 'I visit a binary file in the repo' do - visit namespace_project_blob_path(@project.namespace, @project, File.join( - root_ref, 'files/images/logo-black.png')) - end - - step "I visit my project's commits page" do - visit namespace_project_commits_path(@project.namespace, @project, root_ref, {limit: 5}) - end - - step "I visit my project's commits page for a specific path" do - visit namespace_project_commits_path(@project.namespace, @project, root_ref + "/app/models/project.rb", {limit: 5}) - end - - step 'I visit my project\'s commits stats page' do - visit stats_namespace_project_repository_path(@project.namespace, @project) - end - - step "I visit my project's network page" do - # Stub Graph max_size to speed up test (10 commits vs. 650) - Network::Graph.stub(max_count: 10) - - visit namespace_project_network_path(@project.namespace, @project, root_ref) - end - - step "I visit my project's issues page" do - visit namespace_project_issues_path(@project.namespace, @project) - end - - step "I visit my project's merge requests page" do - visit namespace_project_merge_requests_path(@project.namespace, @project) - end - - step "I visit my project's wiki page" do - visit namespace_project_wiki_path(@project.namespace, @project, :home) - end - - step 'I visit project hooks page' do - visit namespace_project_hooks_path(@project.namespace, @project) - end - - step 'I visit project deploy keys page' do - visit namespace_project_deploy_keys_path(@project.namespace, @project) - end - - # ---------------------------------------- - # "Shop" Project - # ---------------------------------------- - - step 'I visit project "Shop" page' do - visit namespace_project_path(project.namespace, project) - end - - step 'I visit project "Forked Shop" merge requests page' do - visit namespace_project_merge_requests_path(@forked_project.namespace, @forked_project) - end - - step 'I visit edit project "Shop" page' do - visit edit_namespace_project_path(project.namespace, project) - end - - step 'I visit project branches page' do - visit namespace_project_branches_path(@project.namespace, @project) - end - - step 'I visit project protected branches page' do - visit namespace_project_protected_branches_path(@project.namespace, @project) - end - - step 'I visit compare refs page' do - visit namespace_project_compare_index_path(@project.namespace, @project) - end - - step 'I visit project commits page' do - visit namespace_project_commits_path(@project.namespace, @project, root_ref, {limit: 5}) - end - - step 'I visit project commits page for stable branch' do - visit namespace_project_commits_path(@project.namespace, @project, 'stable', {limit: 5}) - end - - step 'I visit project source page' do - visit namespace_project_tree_path(@project.namespace, @project, root_ref) - end - - step 'I visit blob file from repo' do - visit namespace_project_blob_path(@project.namespace, @project, File.join(sample_commit.id, sample_blob.path)) - end - - step 'I visit ".gitignore" file in repo' do - visit namespace_project_blob_path(@project.namespace, @project, File.join(root_ref, '.gitignore')) - end - - step 'I am on the new file page' do - current_path.should eq(namespace_project_create_blob_path(@project.namespace, @project, root_ref)) - end - - step 'I am on the ".gitignore" edit file page' do - current_path.should eq(namespace_project_edit_blob_path( - @project.namespace, @project, File.join(root_ref, '.gitignore'))) - end - - step 'I visit project source page for "6d39438"' do - visit namespace_project_tree_path(@project.namespace, @project, "6d39438") - end - - step 'I visit project source page for' \ - ' "6d394385cf567f80a8fd85055db1ab4c5295806f"' do - visit namespace_project_tree_path(@project.namespace, @project, - '6d394385cf567f80a8fd85055db1ab4c5295806f') - end - - step 'I visit project tags page' do - visit namespace_project_tags_path(@project.namespace, @project) - end - - step 'I visit project commit page' do - visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id) - end - - step 'I visit project "Shop" issues page' do - visit namespace_project_issues_path(project.namespace, project) - end - - step 'I visit issue page "Release 0.4"' do - issue = Issue.find_by(title: "Release 0.4") - visit namespace_project_issue_path(issue.project.namespace, issue.project, issue) - end - - step 'I visit issue page "Tasks-open"' do - issue = Issue.find_by(title: 'Tasks-open') - visit namespace_project_issue_path(issue.project.namespace, issue.project, issue) - end - - step 'I visit issue page "Tasks-closed"' do - issue = Issue.find_by(title: 'Tasks-closed') - visit namespace_project_issue_path(issue.project.namespace, issue.project, issue) - end - - step 'I visit project "Shop" labels page' do - project = Project.find_by(name: 'Shop') - visit namespace_project_labels_path(project.namespace, project) - end - - step 'I visit project "Forum" labels page' do - project = Project.find_by(name: 'Forum') - visit namespace_project_labels_path(project.namespace, project) - end - - step 'I visit project "Shop" new label page' do - project = Project.find_by(name: 'Shop') - visit new_namespace_project_label_path(project.namespace, project) - end - - step 'I visit project "Forum" new label page' do - project = Project.find_by(name: 'Forum') - visit new_namespace_project_label_path(project.namespace, project) - end - - step 'I visit merge request page "Bug NS-04"' do - mr = MergeRequest.find_by(title: "Bug NS-04") - visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) - end - - step 'I visit merge request page "Bug NS-05"' do - mr = MergeRequest.find_by(title: "Bug NS-05") - visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) - end - - step 'I visit merge request page "MR-task-open"' do - mr = MergeRequest.find_by(title: 'MR-task-open') - visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) - end - - step 'I visit merge request page "MR-task-closed"' do - mr = MergeRequest.find_by(title: 'MR-task-closed') - visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) - end - - step 'I visit project "Shop" merge requests page' do - visit namespace_project_merge_requests_path(project.namespace, project) - end - - step 'I visit forked project "Shop" merge requests page' do - visit namespace_project_merge_requests_path(project.namespace, project) - end - - step 'I visit project "Shop" milestones page' do - visit namespace_project_milestones_path(project.namespace, project) - end - - step 'I visit project "Shop" team page' do - visit namespace_project_project_members_path(project.namespace, project) - end - - step 'I visit project wiki page' do - visit namespace_project_wiki_path(@project.namespace, @project, :home) - end - - # ---------------------------------------- - # Visibility Projects - # ---------------------------------------- - - step 'I visit project "Community" page' do - project = Project.find_by(name: "Community") - visit namespace_project_path(project.namespace, project) - end - - step 'I visit project "Community" source page' do - project = Project.find_by(name: 'Community') - visit namespace_project_tree_path(project.namespace, project, root_ref) - end - - step 'I visit project "Internal" page' do - project = Project.find_by(name: "Internal") - visit namespace_project_path(project.namespace, project) - end - - step 'I visit project "Enterprise" page' do - project = Project.find_by(name: "Enterprise") - visit namespace_project_path(project.namespace, project) - end - - # ---------------------------------------- - # Empty Projects - # ---------------------------------------- - - step "I visit empty project page" do - project = Project.find_by(name: "Empty Public Project") - visit namespace_project_path(project.namespace, project) - end - - # ---------------------------------------- - # Public Projects - # ---------------------------------------- - - step 'I visit the public projects area' do - visit explore_projects_path - end - - step 'I visit the explore trending projects' do - visit trending_explore_projects_path - end - - step 'I visit the explore starred projects' do - visit starred_explore_projects_path - end - - step 'I visit the public groups area' do - visit explore_groups_path - end - - # ---------------------------------------- - # Snippets - # ---------------------------------------- - - step 'I visit project "Shop" snippets page' do - visit namespace_project_snippets_path(project.namespace, project) - end - - step 'I visit snippets page' do - visit snippets_path - end - - step 'I visit new snippet page' do - visit new_snippet_path - end - - def root_ref - @project.repository.root_ref - end - - def project - Project.find_by!(name: 'Shop') - end - - # ---------------------------------------- - # Errors - # ---------------------------------------- - - step 'page status code should be 404' do - status_code.should == 404 - end -end diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb deleted file mode 100644 index b60ac5e3423..00000000000 --- a/features/steps/shared/project.rb +++ /dev/null @@ -1,160 +0,0 @@ -module SharedProject - include Spinach::DSL - - # Create a project without caring about what it's called - step "I own a project" do - @project = create(:project, namespace: @user.namespace) - @project.team << [@user, :master] - end - - # Create a specific project called "Shop" - step 'I own project "Shop"' do - @project = Project.find_by(name: "Shop") - @project ||= create(:project, name: "Shop", namespace: @user.namespace, snippets_enabled: true) - @project.team << [@user, :master] - end - - # Add another user to project "Shop" - step 'I add a user to project "Shop"' do - @project = Project.find_by(name: "Shop") - other_user = create(:user, name: 'Alpha') - @project.team << [other_user, :master] - end - - # Create another specific project called "Forum" - step 'I own project "Forum"' do - @project = Project.find_by(name: "Forum") - @project ||= create(:project, name: "Forum", namespace: @user.namespace, path: 'forum_project') - @project.team << [@user, :master] - end - - # Create an empty project without caring about the name - step 'I own an empty project' do - @project = create(:empty_project, - name: 'Empty Project', namespace: @user.namespace) - @project.team << [@user, :master] - end - - step 'I visit my empty project page' do - project = Project.find_by(name: 'Empty Project') - visit namespace_project_path(project.namespace, project) - end - - step 'project "Shop" has push event' do - @project = Project.find_by(name: "Shop") - - data = { - before: Gitlab::Git::BLANK_SHA, - after: "6d394385cf567f80a8fd85055db1ab4c5295806f", - ref: "refs/heads/fix", - user_id: @user.id, - user_name: @user.name, - repository: { - name: @project.name, - url: "localhost/rubinius", - description: "", - homepage: "localhost/rubinius", - private: true - } - } - - @event = Event.create( - project: @project, - action: Event::PUSHED, - data: data, - author_id: @user.id - ) - end - - step 'I should see project "Shop" activity feed' do - project = Project.find_by(name: "Shop") - page.should have_content "#{@user.name} pushed new branch fix at #{project.name_with_namespace}" - end - - step 'I should see project settings' do - current_path.should == edit_namespace_project_path(@project.namespace, @project) - page.should have_content("Project name") - page.should have_content("Features:") - end - - def current_project - @project ||= Project.first - end - - # ---------------------------------------- - # Visibility level - # ---------------------------------------- - - step 'private project "Enterprise"' do - create :project, name: 'Enterprise' - end - - step 'I should see project "Enterprise"' do - page.should have_content "Enterprise" - end - - step 'I should not see project "Enterprise"' do - page.should_not have_content "Enterprise" - end - - step 'internal project "Internal"' do - create :project, :internal, name: 'Internal' - end - - step 'I should see project "Internal"' do - page.should have_content "Internal" - end - - step 'I should not see project "Internal"' do - page.should_not have_content "Internal" - end - - step 'public project "Community"' do - create :project, :public, name: 'Community' - end - - step 'I should see project "Community"' do - page.should have_content "Community" - end - - step 'I should not see project "Community"' do - page.should_not have_content "Community" - end - - step '"John Doe" owns private project "Enterprise"' do - user = user_exists("John Doe", username: "john_doe") - project = Project.find_by(name: "Enterprise") - project ||= create(:empty_project, name: "Enterprise", namespace: user.namespace) - project.team << [user, :master] - end - - step '"John Doe" owns internal project "Internal"' do - user = user_exists("John Doe", username: "john_doe") - project = Project.find_by(name: "Internal") - project ||= create :empty_project, :internal, name: 'Internal', namespace: user.namespace - project.team << [user, :master] - end - - step '"John Doe" owns public project "Community"' do - user = user_exists("John Doe", username: "john_doe") - project = Project.find_by(name: "Community") - project ||= create :empty_project, :public, name: 'Community', namespace: user.namespace - project.team << [user, :master] - end - - step 'public empty project "Empty Public Project"' do - create :project_empty_repo, :public, name: "Empty Public Project" - end - - step 'project "Community" has comments' do - project = Project.find_by(name: "Community") - 2.times { create(:note_on_issue, project: project) } - end - - step 'project "Shop" has labels: "bug", "feature", "enhancement"' do - project = Project.find_by(name: "Shop") - create(:label, project: project, title: 'bug') - create(:label, project: project, title: 'feature') - create(:label, project: project, title: 'enhancement') - end -end diff --git a/features/steps/shared/project_tab.rb b/features/steps/shared/project_tab.rb deleted file mode 100644 index c5aed19331c..00000000000 --- a/features/steps/shared/project_tab.rb +++ /dev/null @@ -1,48 +0,0 @@ -require_relative 'active_tab' - -module SharedProjectTab - include Spinach::DSL - include SharedActiveTab - - step 'the active main tab should be Home' do - ensure_active_main_tab('Project') - end - - step 'the active main tab should be Files' do - ensure_active_main_tab('Files') - end - - step 'the active main tab should be Commits' do - ensure_active_main_tab('Commits') - end - - step 'the active main tab should be Network' do - ensure_active_main_tab('Network') - end - - step 'the active main tab should be Graphs' do - ensure_active_main_tab('Graphs') - end - - step 'the active main tab should be Issues' do - ensure_active_main_tab('Issues') - end - - step 'the active main tab should be Merge Requests' do - ensure_active_main_tab('Merge Requests') - end - - step 'the active main tab should be Snippets' do - ensure_active_main_tab('Snippets') - end - - step 'the active main tab should be Wiki' do - ensure_active_main_tab('Wiki') - end - - step 'the active main tab should be Settings' do - within '.nav-sidebar' do - page.should have_content('Back to project') - end - end -end diff --git a/features/steps/shared/search.rb b/features/steps/shared/search.rb deleted file mode 100644 index 6c3d601763d..00000000000 --- a/features/steps/shared/search.rb +++ /dev/null @@ -1,11 +0,0 @@ -module SharedSearch - include Spinach::DSL - - def search_snippet_contents(query) - visit "/search?search=#{URI::encode(query)}&snippets=true&scope=snippet_blobs" - end - - def search_snippet_titles(query) - visit "/search?search=#{URI::encode(query)}&snippets=true&scope=snippet_titles" - end -end diff --git a/features/steps/shared/shortcuts.rb b/features/steps/shared/shortcuts.rb deleted file mode 100644 index bbb7afec0ad..00000000000 --- a/features/steps/shared/shortcuts.rb +++ /dev/null @@ -1,18 +0,0 @@ -module SharedActiveTab - include Spinach::DSL - - step 'I press "g" and "p"' do - find('body').native.send_key('g') - find('body').native.send_key('p') - end - - step 'I press "g" and "i"' do - find('body').native.send_key('g') - find('body').native.send_key('i') - end - - step 'I press "g" and "m"' do - find('body').native.send_key('g') - find('body').native.send_key('m') - end -end diff --git a/features/steps/shared/snippet.rb b/features/steps/shared/snippet.rb deleted file mode 100644 index bb596c1620a..00000000000 --- a/features/steps/shared/snippet.rb +++ /dev/null @@ -1,63 +0,0 @@ -module SharedSnippet - include Spinach::DSL - - step 'I have public "Personal snippet one" snippet' do - create(:personal_snippet, - title: "Personal snippet one", - content: "Test content", - file_name: "snippet.rb", - visibility_level: Snippet::PUBLIC, - author: current_user) - end - - step 'I have private "Personal snippet private" snippet' do - create(:personal_snippet, - title: "Personal snippet private", - content: "Provate content", - file_name: "private_snippet.rb", - visibility_level: Snippet::PRIVATE, - author: current_user) - end - - step 'I have internal "Personal snippet internal" snippet' do - create(:personal_snippet, - title: "Personal snippet internal", - content: "Provate content", - file_name: "internal_snippet.rb", - visibility_level: Snippet::INTERNAL, - author: current_user) - end - - step 'I have a public many lined snippet' do - create(:personal_snippet, - title: 'Many lined snippet', - content: <<-END.gsub(/^\s+\|/, ''), - |line one - |line two - |line three - |line four - |line five - |line six - |line seven - |line eight - |line nine - |line ten - |line eleven - |line twelve - |line thirteen - |line fourteen - END - file_name: 'many_lined_snippet.rb', - visibility_level: Snippet::PUBLIC, - author: current_user) - end - - step 'There is public "Personal snippet one" snippet' do - create(:personal_snippet, - title: "Personal snippet one", - content: "Test content", - file_name: "snippet.rb", - visibility_level: Snippet::PUBLIC, - author: create(:user)) - end -end diff --git a/features/steps/shared/user.rb b/features/steps/shared/user.rb deleted file mode 100644 index 209d77c7acf..00000000000 --- a/features/steps/shared/user.rb +++ /dev/null @@ -1,17 +0,0 @@ -module SharedUser - include Spinach::DSL - - step 'User "John Doe" exists' do - user_exists("John Doe", {username: "john_doe"}) - end - - step 'User "Mary Jane" exists' do - user_exists("Mary Jane", {username: "mary_jane"}) - end - - protected - - def user_exists(name, options = {}) - User.find_by(name: name) || create(:user, {name: name, admin: false}.merge(options)) - end -end diff --git a/features/steps/snippet_search.rb b/features/steps/snippet_search.rb deleted file mode 100644 index 669c7186c1b..00000000000 --- a/features/steps/snippet_search.rb +++ /dev/null @@ -1,56 +0,0 @@ -class Spinach::Features::SnippetSearch < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedSnippet - include SharedUser - include SharedSearch - - step 'I search for "snippet" in snippet titles' do - search_snippet_titles 'snippet' - end - - step 'I search for "snippet private" in snippet titles' do - search_snippet_titles 'snippet private' - end - - step 'I search for "line seven" in snippet contents' do - search_snippet_contents 'line seven' - end - - step 'I should see "line seven" in results' do - page.should have_content 'line seven' - end - - step 'I should see "line four" in results' do - page.should have_content 'line four' - end - - step 'I should see "line ten" in results' do - page.should have_content 'line ten' - end - - step 'I should not see "line eleven" in results' do - page.should_not have_content 'line eleven' - end - - step 'I should not see "line three" in results' do - page.should_not have_content 'line three' - end - - step 'I should see "Personal snippet one" in results' do - page.should have_content 'Personal snippet one' - end - - step 'I should see "Personal snippet private" in results' do - page.should have_content 'Personal snippet private' - end - - step 'I should not see "Personal snippet one" in results' do - page.should_not have_content 'Personal snippet one' - end - - step 'I should not see "Personal snippet private" in results' do - page.should_not have_content 'Personal snippet private' - end - -end diff --git a/features/steps/snippets/discover.rb b/features/steps/snippets/discover.rb deleted file mode 100644 index 2667c1e3d44..00000000000 --- a/features/steps/snippets/discover.rb +++ /dev/null @@ -1,21 +0,0 @@ -class Spinach::Features::SnippetsDiscover < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedSnippet - - step 'I should see "Personal snippet one" in snippets' do - page.should have_content "Personal snippet one" - end - - step 'I should see "Personal snippet internal" in snippets' do - page.should have_content "Personal snippet internal" - end - - step 'I should not see "Personal snippet private" in snippets' do - page.should_not have_content "Personal snippet private" - end - - def snippet - @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one") - end -end diff --git a/features/steps/snippets/public_snippets.rb b/features/steps/snippets/public_snippets.rb deleted file mode 100644 index 67669dc0a69..00000000000 --- a/features/steps/snippets/public_snippets.rb +++ /dev/null @@ -1,25 +0,0 @@ -class Spinach::Features::PublicSnippets < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedSnippet - - step 'I should see snippet "Personal snippet one"' do - page.should have_no_xpath("//i[@class='public-snippet']") - end - - step 'I should see raw snippet "Personal snippet one"' do - page.should have_text(snippet.content) - end - - step 'I visit snippet page "Personal snippet one"' do - visit snippet_path(snippet) - end - - step 'I visit snippet raw page "Personal snippet one"' do - visit raw_snippet_path(snippet) - end - - def snippet - @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one") - end -end diff --git a/features/steps/snippets/snippets.rb b/features/steps/snippets/snippets.rb deleted file mode 100644 index de936db85ee..00000000000 --- a/features/steps/snippets/snippets.rb +++ /dev/null @@ -1,64 +0,0 @@ -class Spinach::Features::Snippets < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - include SharedSnippet - - step 'I click link "Personal snippet one"' do - click_link "Personal snippet one" - end - - step 'I should not see "Personal snippet one" in snippets' do - page.should_not have_content "Personal snippet one" - end - - step 'I click link "Edit"' do - within ".file-title" do - click_link "Edit" - end - end - - step 'I click link "Destroy"' do - click_link "remove" - end - - step 'I submit new snippet "Personal snippet three"' do - fill_in "personal_snippet_title", :with => "Personal snippet three" - fill_in "personal_snippet_file_name", :with => "my_snippet.rb" - within('.file-editor') do - find(:xpath, "//input[@id='personal_snippet_content']").set 'Content of snippet three' - end - click_button "Create snippet" - end - - step 'I should see snippet "Personal snippet three"' do - page.should have_content "Personal snippet three" - page.should have_content "Content of snippet three" - end - - step 'I submit new title "Personal snippet new title"' do - fill_in "personal_snippet_title", :with => "Personal snippet new title" - click_button "Save" - end - - step 'I should see "Personal snippet new title"' do - page.should have_content "Personal snippet new title" - end - - step 'I uncheck "Private" checkbox' do - choose "Internal" - click_button "Save" - end - - step 'I should see "Personal snippet one" public' do - page.should have_no_xpath("//i[@class='public-snippet']") - end - - step 'I visit snippet page "Personal snippet one"' do - visit snippet_path(snippet) - end - - def snippet - @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one") - end -end diff --git a/features/steps/snippets/user.rb b/features/steps/snippets/user.rb deleted file mode 100644 index 866f637ab6c..00000000000 --- a/features/steps/snippets/user.rb +++ /dev/null @@ -1,55 +0,0 @@ -class Spinach::Features::SnippetsUser < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedSnippet - - step 'I visit my snippets page' do - visit user_snippets_path(current_user) - end - - step 'I should see "Personal snippet one" in snippets' do - page.should have_content "Personal snippet one" - end - - step 'I should see "Personal snippet private" in snippets' do - page.should have_content "Personal snippet private" - end - - step 'I should see "Personal snippet internal" in snippets' do - page.should have_content "Personal snippet internal" - end - - step 'I should not see "Personal snippet one" in snippets' do - page.should_not have_content "Personal snippet one" - end - - step 'I should not see "Personal snippet private" in snippets' do - page.should_not have_content "Personal snippet private" - end - - step 'I should not see "Personal snippet internal" in snippets' do - page.should_not have_content "Personal snippet internal" - end - - step 'I click "Internal" filter' do - within('.nav-stacked') do - click_link "Internal" - end - end - - step 'I click "Private" filter' do - within('.nav-stacked') do - click_link "Private" - end - end - - step 'I click "Public" filter' do - within('.nav-stacked') do - click_link "Public" - end - end - - def snippet - @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one") - end -end diff --git a/features/steps/user.rb b/features/steps/user.rb deleted file mode 100644 index 10cae692a88..00000000000 --- a/features/steps/user.rb +++ /dev/null @@ -1,43 +0,0 @@ -class Spinach::Features::User < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedUser - include SharedProject - - step 'I should see user "John Doe" page' do - expect(title).to match(/^\s*John Doe/) - end - - step '"John Doe" has contributions' do - user = User.find_by(name: 'John Doe') - project = contributed_project - - # Issue controbution - issue_params = { title: 'Bug in old browser' } - Issues::CreateService.new(project, user, issue_params).execute - - # Push code contribution - push_params = { - project: project, - action: Event::PUSHED, - author_id: user.id, - data: { commit_count: 3 } - } - - Event.create(push_params) - end - - step 'I should see contributed projects' do - within '.contributed-projects' do - page.should have_content(@contributed_project.name) - end - end - - step 'I should see contributions calendar' do - page.should have_css('.cal-heatmap-container') - end - - def contributed_project - @contributed_project ||= create(:project, :public) - end -end |