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

91 lines
2.5 KiB
Ruby
Raw Normal View History

class Dashboard < Spinach::FeatureSteps
2012-09-10 11:35:03 -04:00
include SharedAuthentication
include SharedPaths
2013-01-09 00:14:05 -05:00
include SharedProject
2012-09-10 11:35:03 -04:00
Then 'I should see "New Project" link' do
2013-08-27 06:49:29 -04:00
page.should have_link "New project"
end
Then 'I should see "Shop" project link' do
page.should have_link "Shop"
end
Then 'I should see last push widget' do
page.should have_content "You pushed to new_design"
page.should have_link "Create Merge Request"
end
And 'I click "Create Merge Request" link' do
click_link "Create Merge Request"
end
Then 'I see prefilled new Merge Request page' do
current_path.should == new_project_merge_request_path(@project)
Merge Request on forked projects The good: - You can do a merge request for a forked commit and it will merge properly (i.e. it does work). - Push events take into account merge requests on forked projects - Tests around merge_actions now present, spinach, and other rspec tests - Satellites now clean themselves up rather then recreate The questionable: - Events only know about target projects - Project's merge requests only hold on to MR's where they are the target - All operations performed in the satellite The bad: - Duplication between project's repositories and satellites (e.g. commits_between) (for reference: http://feedback.gitlab.com/forums/176466-general/suggestions/3456722-merge-requests-between-projects-repos) Fixes: Make test repos/satellites only create when needed -Spinach/Rspec now only initialize test directory, and setup stubs (things that are relatively cheap) -project_with_code, source_project_with_code, and target_project_with_code now create/destroy their repos individually -fixed remote removal -How to merge renders properly -Update emails to show project/branches -Edit MR doesn't set target branch -Fix some failures on editing/creating merge requests, added a test -Added back a test around merge request observer -Clean up project_transfer_spec, Remove duplicate enable/disable observers -Ensure satellite lock files are cleaned up, Attempted to add some testing around these as well -Signifant speed ups for tests -Update formatting ordering in notes_on_merge_requests -Remove wiki schema update Fixes for search/search results -Search results was using by_project for a list of projects, updated this to use in_projects -updated search results to reference the correct (target) project -udpated search results to print both sides of the merge request Change-Id: I19407990a0950945cc95d62089cbcc6262dab1a8
2013-04-25 10:15:33 -04:00
find("#merge_request_target_project_id").value.should == @project.id.to_s
find("#merge_request_source_branch").value.should == "new_design"
find("#merge_request_target_branch").value.should == "master"
find("#merge_request_title").value.should == "New Design"
end
Given 'user with name "John Doe" joined project "Shop"' do
user = create(:user, {name: "John Doe"})
2013-06-22 16:57:29 -04:00
project.team << [user, :master]
Event.create(
project: project,
author_id: user.id,
2013-02-13 06:48:16 -05:00
action: Event::JOINED
)
end
2012-10-02 05:27:21 -04:00
Then 'I should see "John Doe joined project at Shop" event' do
2013-06-22 16:57:29 -04:00
page.should have_content "John Doe joined project at #{project.name_with_namespace}"
end
And 'user with name "John Doe" left project "Shop"' do
user = User.find_by_name "John Doe"
Event.create(
project: project,
author_id: user.id,
2013-02-13 06:48:16 -05:00
action: Event::LEFT
)
end
2012-10-02 05:27:21 -04:00
Then 'I should see "John Doe left project at Shop" event' do
2013-06-22 16:57:29 -04:00
page.should have_content "John Doe left project at #{project.name_with_namespace}"
end
2012-10-03 16:46:55 -04:00
And 'I have group with projects' do
@group = create(:group)
@project = create(:project, namespace: @group)
@event = create(:closed_issue_event, project: @project)
2012-10-03 16:46:55 -04:00
@project.team << [current_user, :master]
2012-10-03 16:46:55 -04:00
end
2013-01-27 08:41:35 -05:00
Then 'I should see projects list' do
@user.authorized_projects.all.each do |project|
page.should have_link project.name_with_namespace
end
end
2012-10-03 16:46:55 -04:00
Then 'I should see groups list' do
Group.all.each do |group|
page.should have_link group.name
end
end
2012-11-28 12:59:19 -05:00
And 'group has a projects that does not belongs to me' do
@forbidden_project1 = create(:project, group: @group)
@forbidden_project2 = create(:project, group: @group)
end
Then 'I should see 1 project at group list' do
page.find('span.last_activity/span').should have_content('1')
end
2013-06-22 16:57:29 -04:00
def project
@project ||= Project.find_by_name "Shop"
end
end