2012-12-02 20:18:03 +00:00
|
|
|
class EventFilters < Spinach::FeatureSteps
|
|
|
|
include SharedAuthentication
|
2013-04-07 09:32:24 +00:00
|
|
|
include SharedPaths
|
2012-12-02 20:18:03 +00:00
|
|
|
include SharedProject
|
|
|
|
|
|
|
|
Then 'I should see push event' do
|
2012-12-03 00:29:07 +00:00
|
|
|
page.should have_selector('span.pushed')
|
2012-12-02 20:54:19 +00:00
|
|
|
end
|
2013-04-07 09:32:24 +00:00
|
|
|
|
2012-12-02 20:54:19 +00:00
|
|
|
Then 'I should not see push event' do
|
2012-12-03 00:29:07 +00:00
|
|
|
page.should_not have_selector('span.pushed')
|
2012-12-02 20:18:03 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should see new member event' do
|
2012-12-03 00:29:07 +00:00
|
|
|
page.should have_selector('span.joined')
|
2012-12-02 20:54:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
And 'I should not see new member event' do
|
2012-12-03 00:29:07 +00:00
|
|
|
page.should_not have_selector('span.joined')
|
2012-12-02 20:18:03 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should see merge request event' do
|
2013-04-07 09:32:24 +00:00
|
|
|
page.should have_selector('span.accepted')
|
2012-12-02 20:54:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
And 'I should not see merge request event' do
|
2013-04-07 09:32:24 +00:00
|
|
|
page.should_not have_selector('span.accepted')
|
2012-12-02 20:18:03 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
And 'this project has push event' do
|
|
|
|
data = {
|
|
|
|
before: "0000000000000000000000000000000000000000",
|
|
|
|
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
|
|
|
|
|
|
|
|
And 'this project has new member event' do
|
|
|
|
user = create(:user, {name: "John Doe"})
|
|
|
|
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
|
|
|
|
|
|
|
|
And 'this project has merge request event' do
|
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
|
|
|
|
|