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 39839eb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 25 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"

13 changes: 4 additions & 9 deletions features/step_definitions/repository_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -295,16 +295,11 @@
expect(page.driver.status_code).to eq(404)
end

Then(/^I should see a div with class "(.*?)"$/) do |arg1|
page.all("div.#{arg1}")
end

Then(/^I should see the correct notify push url$/) do
step "I should see \"Notify Push Url for Gitlab\""
expect(page).to have_selector("input[value=\"#{repository_notify_push_url(host: Capybara.current_session.server.host, port: Capybara.current_session.server.port, locale: :en, id: @repository.id)}\"]")
end

When(/^I click on the center of the color picker$/) do
page.find('div.colorpicker_color').click
end

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

0 comments on commit 39839eb

Please sign in to comment.