Commit b255c3c44b849510e19be88833bb73425b8d0e9d
1 parent
2b932015
Exists in
master
and in
4 other branches
Tests on events filtering added
Showing
3 changed files
with
46 additions
and
5 deletions
Show diff stats
app/helpers/events_helper.rb
@@ -32,7 +32,7 @@ module EventsHelper | @@ -32,7 +32,7 @@ module EventsHelper | ||
32 | end | 32 | end |
33 | 33 | ||
34 | content_tag :div, class: "filter_icon #{inactive}" do | 34 | content_tag :div, class: "filter_icon #{inactive}" do |
35 | - link_to dashboard_path(event_filter: filter), class: 'has_tooltip', 'data-original-title' => tooltip do | 35 | + link_to dashboard_path(event_filter: filter), class: 'has_tooltip', id: "#{key}_event_filter", 'data-original-title' => tooltip do |
36 | image_tag "event_filter_#{key}.png" | 36 | image_tag "event_filter_#{key}.png" |
37 | end | 37 | end |
38 | end | 38 | end |
features/dashboard/event_filters.feature
@@ -9,6 +9,23 @@ Feature: Event filters | @@ -9,6 +9,23 @@ Feature: Event filters | ||
9 | 9 | ||
10 | Scenario: I should see all events | 10 | Scenario: I should see all events |
11 | Then I should see push event | 11 | Then I should see push event |
12 | + And I should see new member event | ||
13 | + And I should see merge request event | ||
14 | + | ||
15 | + Scenario: I should see only pushed events | ||
16 | + When I click "push" event filter | ||
17 | + Then I should see push event | ||
18 | + And I should not see new member event | ||
19 | + And I should not see merge request event | ||
20 | + | ||
21 | + Scenario: I should see only joined events | ||
22 | + When I click "team" event filter | ||
12 | Then I should see new member event | 23 | Then I should see new member event |
13 | - Then I should see merge request event | 24 | + And I should not see push event |
25 | + And I should not see merge request event | ||
14 | 26 | ||
27 | + Scenario: I should see only merged events | ||
28 | + When I click "merge" event filter | ||
29 | + Then I should see merge request event | ||
30 | + And I should not see push event | ||
31 | + And I should not see new member event |
features/steps/dashboard/dashboard_event_filters.rb
@@ -4,15 +4,27 @@ class EventFilters < Spinach::FeatureSteps | @@ -4,15 +4,27 @@ class EventFilters < Spinach::FeatureSteps | ||
4 | include SharedProject | 4 | include SharedProject |
5 | 5 | ||
6 | Then 'I should see push event' do | 6 | Then 'I should see push event' do |
7 | - page.find('span.pushed').should have_content('pushed') | 7 | + page.has_selector?('span.pushed').should be_true |
8 | + end | ||
9 | + | ||
10 | + Then 'I should not see push event' do | ||
11 | + page.has_selector?('span.pushed').should be_false | ||
8 | end | 12 | end |
9 | 13 | ||
10 | Then 'I should see new member event' do | 14 | Then 'I should see new member event' do |
11 | - page.find('span.joined').should have_content('joined') | 15 | + page.has_selector?('span.joined').should be_true |
16 | + end | ||
17 | + | ||
18 | + And 'I should not see new member event' do | ||
19 | + page.has_selector?('span.joined').should be_false | ||
12 | end | 20 | end |
13 | 21 | ||
14 | Then 'I should see merge request event' do | 22 | Then 'I should see merge request event' do |
15 | - page.find('span.merged').should have_content('merged') | 23 | + page.has_selector?('span.merged').should be_true |
24 | + end | ||
25 | + | ||
26 | + And 'I should not see merge request event' do | ||
27 | + page.has_selector?('span.merged').should be_false | ||
16 | end | 28 | end |
17 | 29 | ||
18 | And 'this project has push event' do | 30 | And 'this project has push event' do |
@@ -59,5 +71,17 @@ class EventFilters < Spinach::FeatureSteps | @@ -59,5 +71,17 @@ class EventFilters < Spinach::FeatureSteps | ||
59 | ) | 71 | ) |
60 | end | 72 | end |
61 | 73 | ||
74 | + When 'I click "push" event filter' do | ||
75 | + click_link("push_event_filter") | ||
76 | + end | ||
77 | + | ||
78 | + When 'I click "team" event filter' do | ||
79 | + click_link("team_event_filter") | ||
80 | + end | ||
81 | + | ||
82 | + When 'I click "merge" event filter' do | ||
83 | + click_link("merged_event_filter") | ||
84 | + end | ||
85 | + | ||
62 | end | 86 | end |
63 | 87 |