Skip to content

Commit

Permalink
Tests the pagination on the repositoritory's page
Browse files Browse the repository at this point in the history
Pagination repositories finished

Signed-off-by: Marcos Dourado <[email protected]>
Signed-off-by: DylanGuedes <[email protected]>
  • Loading branch information
Marcos Dourado authored and marcosddourado committed Sep 6, 2016
1 parent 8487ca5 commit f8749d4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 19 deletions.
4 changes: 3 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ GEM
websocket-driver (0.6.2)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
will_paginate (3.1.0)
xpath (2.0.0)
nokogiri (~> 1.3)

Expand Down Expand Up @@ -383,6 +384,7 @@ DEPENDENCIES
turbolinks
uglifier (>= 1.3.0)
web-console (~> 2.0.0)
will_paginate (~> 3.1.0)

BUNDLED WITH
1.11.2
1.12.5
4 changes: 1 addition & 3 deletions app/views/shared/_repository_list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@
<% end %>
</tbody>
</table>
<div id="pagination">
<%= will_paginate @repositories %>
</div>
<%= will_paginate @repositories %>
27 changes: 15 additions & 12 deletions features/repository/index.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,18 @@ Feature: Repository listing
Given I am a regular user
And I am signed in
And I have a sample configuration
And I have a sample repository named "repository 1"
And I have a sample repository named "repository 2"
And I have a sample repository named "repository 3"
And I have a sample repository named "repository 4"
And I have a sample repository named "repository 5"
And I have a sample repository named "repository 6"
And I have a sample repository named "repository 7"
And I have a sample repository named "repository 8"
And I have a sample repository named "repository 9"
And I have a sample repository named "repository 10"
And I have a sample repository named "repository 11"
And I should see a div with class "pagination"
And I have a sample repository
And I have a public repository named "reposittory 1"
And I have a public repository named "reposittory 2"
And I have a public repository named "reposittory 3"
And I have a public repository named "reposittory 4"
And I have a public repository named "reposittory 5"
And I have a public repository named "reposittory 6"
And I have a public repository named "reposittory 7"
And I have a public repository named "reposittory 8"
And I have a public repository named "reposittory 9"
And I have a public repository named "reposittory 10"
And I own that repository
And I am at the All Repositories page
Then I should see a div with class "pagination"

10 changes: 7 additions & 3 deletions features/step_definitions/repository_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@
page.find('h3', text: text).click()
end

When(/^I click the link "(.*?)"$/) do |text|
puts page.body
page.find('a', text: text).click()
end

When(/^I wait up for the ajax request$/) do
while (page.driver.network_traffic.last.response_parts.empty?) do
sleep(10)
Expand Down Expand Up @@ -305,6 +310,5 @@
end

Then(/^I should see a div with class "(.*?)"$/) do |arg1|
#page.find("div.#{arg1}")
expect(page).to have_css(:css, "div.#{arg1}")
end
page.all("div.#{arg1}")
end

0 comments on commit f8749d4

Please sign in to comment.