gitlab-org--gitlab-foss/features/steps/group/group.rb
Izaak Alpert 3d7194f011 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-07-17 22:41:30 -04:00

113 lines
2.9 KiB
Ruby

class Groups < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include Select2Helper
Then 'I should see projects list' do
current_user.authorized_projects.each do |project|
page.should have_link project.name
end
end
And 'I have group with projects' do
@group = create(:group, owner: current_user)
@project = create(:project, group: @group)
@event = create(:closed_issue_event, project: @project)
@project.team << [current_user, :master]
end
And 'I should see projects activity feed' do
page.should have_content 'closed issue'
end
Then 'I should see issues from this group assigned to me' do
assigned_to_me(:issues).each do |issue|
page.should have_content issue.title
end
end
Then 'I should see merge requests from this group assigned to me' do
assigned_to_me(:merge_requests).each do |issue|
page.should have_content issue.title[0..80]
end
end
Given 'I have new user "John"' do
create(:user, name: "John")
end
And 'I select user "John" from list with role "Reporter"' do
user = User.find_by_name("John")
within ".new_users_group" do
select2(user.id, from: "#user_ids", multiple: true)
select "Reporter", from: "group_access"
end
click_button "Add users into group"
end
Then 'I should see user "John" in team list' do
projects_with_access = find(".ui-box .well-list")
projects_with_access.should have_content("John")
end
Given 'project from group has issues assigned to me' do
create :issue,
project: project,
assignee: current_user,
author: current_user
end
Given 'project from group has merge requests assigned to me' do
create :merge_request,
source_project: project,
target_project: project,
assignee: current_user,
author: current_user
end
When 'I click new group link' do
click_link "New Group"
end
And 'submit form with new group info' do
fill_in 'group_name', with: 'Samurai'
fill_in 'group_description', with: 'Tokugawa Shogunate'
click_button "Create group"
end
Then 'I should see newly created group' do
page.should have_content "Samurai"
page.should have_content "Tokugawa Shogunate"
page.should have_content "You will only see events from projects in this group"
end
Then 'I should be redirected to group page' do
current_path.should == group_path(Group.last)
end
And 'I change group name' do
fill_in 'group_name', with: 'new-name'
click_button "Save group"
end
Then 'I should see new group name' do
within ".navbar-gitlab" do
page.should have_content "group: new-name"
end
end
protected
def current_group
@group ||= Group.first
end
def project
current_group.projects.first
end
def assigned_to_me key
project.send(key).where(assignee_id: current_user.id)
end
end