Commit 2b93201533d0d5c7fdcb9b6e74f0eec944ed0ea9
1 parent
d27cc91e
Exists in
master
and in
4 other branches
Tests on EventFilters added
Showing
2 changed files
with
77 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | +Feature: Event filters | |
| 2 | + Background: | |
| 3 | + Given I sign in as a user | |
| 4 | + And I own a project | |
| 5 | + And this project has push event | |
| 6 | + And this project has new member event | |
| 7 | + And this project has merge request event | |
| 8 | + And I visit dashboard page | |
| 9 | + | |
| 10 | + Scenario: I should see all events | |
| 11 | + Then I should see push event | |
| 12 | + Then I should see new member event | |
| 13 | + Then I should see merge request event | |
| 14 | + | ... | ... |
| ... | ... | @@ -0,0 +1,63 @@ |
| 1 | +class EventFilters < Spinach::FeatureSteps | |
| 2 | + include SharedAuthentication | |
| 3 | + include SharedPaths | |
| 4 | + include SharedProject | |
| 5 | + | |
| 6 | + Then 'I should see push event' do | |
| 7 | + page.find('span.pushed').should have_content('pushed') | |
| 8 | + end | |
| 9 | + | |
| 10 | + Then 'I should see new member event' do | |
| 11 | + page.find('span.joined').should have_content('joined') | |
| 12 | + end | |
| 13 | + | |
| 14 | + Then 'I should see merge request event' do | |
| 15 | + page.find('span.merged').should have_content('merged') | |
| 16 | + end | |
| 17 | + | |
| 18 | + And 'this project has push event' do | |
| 19 | + data = { | |
| 20 | + before: "0000000000000000000000000000000000000000", | |
| 21 | + after: "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e", | |
| 22 | + ref: "refs/heads/new_design", | |
| 23 | + user_id: @user.id, | |
| 24 | + user_name: @user.name, | |
| 25 | + repository: { | |
| 26 | + name: @project.name, | |
| 27 | + url: "localhost/rubinius", | |
| 28 | + description: "", | |
| 29 | + homepage: "localhost/rubinius", | |
| 30 | + private: true | |
| 31 | + } | |
| 32 | + } | |
| 33 | + | |
| 34 | + @event = Event.create( | |
| 35 | + project: @project, | |
| 36 | + action: Event::Pushed, | |
| 37 | + data: data, | |
| 38 | + author_id: @user.id | |
| 39 | + ) | |
| 40 | + end | |
| 41 | + | |
| 42 | + And 'this project has new member event' do | |
| 43 | + user = create(:user, {name: "John Doe"}) | |
| 44 | + Event.create( | |
| 45 | + project: @project, | |
| 46 | + author_id: user.id, | |
| 47 | + action: Event::Joined | |
| 48 | + ) | |
| 49 | + end | |
| 50 | + | |
| 51 | + And 'this project has merge request event' do | |
| 52 | + merge_request = create :merge_request, author: @user, project: @project | |
| 53 | + Event.create( | |
| 54 | + project: @project, | |
| 55 | + action: Event::Merged, | |
| 56 | + target_id: merge_request.id, | |
| 57 | + target_type: "MergeRequest", | |
| 58 | + author_id: @user.id | |
| 59 | + ) | |
| 60 | + end | |
| 61 | + | |
| 62 | +end | |
| 63 | + | ... | ... |