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

86 lines
2.1 KiB
Ruby
Raw Normal View History

class Spinach::Features::EventFilters < Spinach::FeatureSteps
2012-12-02 20:18:03 +00:00
include SharedAuthentication
2013-04-07 09:32:24 +00:00
include SharedPaths
2012-12-02 20:18:03 +00:00
include SharedProject
step 'I should see push event' do
expect(page).to have_selector('span.pushed')
2012-12-02 20:54:19 +00:00
end
2013-04-07 09:32:24 +00:00
step 'I should not see push event' do
expect(page).not_to have_selector('span.pushed')
2012-12-02 20:18:03 +00:00
end
step 'I should see new member event' do
expect(page).to have_selector('span.joined')
2012-12-02 20:54:19 +00:00
end
step 'I should not see new member event' do
expect(page).not_to have_selector('span.joined')
2012-12-02 20:18:03 +00:00
end
step 'I should see merge request event' do
expect(page).to have_selector('span.accepted')
2012-12-02 20:54:19 +00:00
end
step 'I should not see merge request event' do
expect(page).not_to have_selector('span.accepted')
2012-12-02 20:18:03 +00:00
end
step 'this project has push event' do
2012-12-02 20:18:03 +00:00
data = {
2014-11-03 19:35:06 +00:00
before: Gitlab::Git::BLANK_SHA,
2012-12-02 20:18:03 +00:00
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,
2013-02-13 11:48:16 +00:00
action: Event::PUSHED,
2012-12-02 20:18:03 +00:00
data: data,
author_id: @user.id
)
end
step 'this project has new member event' do
user = create(:user, { name: "John Doe" })
2012-12-02 20:18:03 +00:00
Event.create(
project: @project,
author_id: user.id,
2013-02-13 11:48:16 +00:00
action: Event::JOINED
2012-12-02 20:18:03 +00:00
)
end
step 'this project has merge request event' do
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 14:15:33 +00:00
merge_request = create :merge_request, author: @user, source_project: @project, target_project: @project
2012-12-02 20:18:03 +00:00
Event.create(
project: @project,
2013-02-13 11:48:16 +00:00
action: Event::MERGED,
2012-12-02 20:18:03 +00:00
target_id: merge_request.id,
target_type: "MergeRequest",
author_id: @user.id
2013-04-07 09:32:24 +00:00
)
2012-12-02 20:18:03 +00:00
end
2012-12-02 20:54:19 +00:00
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
2012-12-02 20:18:03 +00:00
end