Commit b255c3c4 authored by Alex Denisov's avatar Alex Denisov

Tests on events filtering added

parent 2b932015
......@@ -32,7 +32,7 @@ module EventsHelper
end
content_tag :div, class: "filter_icon #{inactive}" do
link_to dashboard_path(event_filter: filter), class: 'has_tooltip', 'data-original-title' => tooltip do
link_to dashboard_path(event_filter: filter), class: 'has_tooltip', id: "#{key}_event_filter", 'data-original-title' => tooltip do
image_tag "event_filter_#{key}.png"
end
end
......
......@@ -9,6 +9,23 @@ Feature: Event filters
Scenario: I should see all events
Then I should see push event
And I should see new member event
And I should see merge request event
Scenario: I should see only pushed events
When I click "push" event filter
Then I should see push event
And I should not see new member event
And I should not see merge request event
Scenario: I should see only joined events
When I click "team" event filter
Then I should see new member event
Then I should see merge request event
And I should not see push event
And I should not see merge request event
Scenario: I should see only merged events
When I click "merge" event filter
Then I should see merge request event
And I should not see push event
And I should not see new member event
......@@ -4,15 +4,27 @@ class EventFilters < Spinach::FeatureSteps
include SharedProject
Then 'I should see push event' do
page.find('span.pushed').should have_content('pushed')
page.has_selector?('span.pushed').should be_true
end
Then 'I should not see push event' do
page.has_selector?('span.pushed').should be_false
end
Then 'I should see new member event' do
page.find('span.joined').should have_content('joined')
page.has_selector?('span.joined').should be_true
end
And 'I should not see new member event' do
page.has_selector?('span.joined').should be_false
end
Then 'I should see merge request event' do
page.find('span.merged').should have_content('merged')
page.has_selector?('span.merged').should be_true
end
And 'I should not see merge request event' do
page.has_selector?('span.merged').should be_false
end
And 'this project has push event' do
......@@ -59,5 +71,17 @@ class EventFilters < Spinach::FeatureSteps
)
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment