Commit f0bfeb6e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Refactor explore area tests. Replaced old links

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 367445fd
...@@ -46,5 +46,5 @@ ...@@ -46,5 +46,5 @@
%br %br
Public projects are an easy way to allow everyone to have read-only access. Public projects are an easy way to allow everyone to have read-only access.
.link_holder .link_holder
= link_to public_projects_path, class: "btn btn-new" do = link_to explore_projects_path, class: "btn btn-new" do
Browse public projects » Browse public projects »
.clearfix .clearfix
.pull-left .pull-left
= form_tag public_projects_path, method: :get, class: 'form-inline form-tiny' do |f| = form_tag explore_projects_path, method: :get, class: 'form-inline form-tiny' do |f|
.form-group .form-group
= search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input input-mn-300", id: "projects_search" = search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input input-mn-300", id: "projects_search"
.form-group .form-group
...@@ -17,15 +17,15 @@ ...@@ -17,15 +17,15 @@
%b.caret %b.caret
%ul.dropdown-menu %ul.dropdown-menu
%li %li
= link_to public_projects_path(sort: nil) do = link_to explore_projects_path(sort: nil) do
Name Name
= link_to public_projects_path(sort: 'newest') do = link_to explore_projects_path(sort: 'newest') do
Newest Newest
= link_to public_projects_path(sort: 'oldest') do = link_to explore_projects_path(sort: 'oldest') do
Oldest Oldest
= link_to public_projects_path(sort: 'recently_updated') do = link_to explore_projects_path(sort: 'recently_updated') do
Recently updated Recently updated
= link_to public_projects_path(sort: 'last_updated') do = link_to explore_projects_path(sort: 'last_updated') do
Last updated Last updated
%hr %hr
......
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
= render @trending_projects = render @trending_projects
.center .center
= link_to 'Show all projects', public_projects_path, class: 'btn btn-primary' = link_to 'Show all projects', explore_projects_path, class: 'btn btn-primary'
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
.container .container
%div.app_logo %div.app_logo
%span.separator %span.separator
= link_to public_root_path, class: "home" do = link_to explore_root_path, class: "home" do
%h1 GITLAB %h1 GITLAB
%span.separator %span.separator
%h1.title= title %h1.title= title
......
@public @public
Feature: Public Projects Feature Feature: Explore Projects Feature
Background: Background:
Given public project "Community" Given public project "Community"
And internal project "Internal" And internal project "Internal"
......
@public @public
Feature: Public Projects Feature Feature: Explore Groups Feature
Background: Background:
Given group "TestGroup" has private project "Enterprise" Given group "TestGroup" has private project "Enterprise"
......
class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps class Spinach::Features::ExploreGroupsFeature < Spinach::FeatureSteps
include SharedAuthentication include SharedAuthentication
include SharedPaths include SharedPaths
include SharedGroup include SharedGroup
...@@ -15,7 +15,7 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps ...@@ -15,7 +15,7 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps
step 'group "TestGroup" has public project "Community"' do step 'group "TestGroup" has public project "Community"' do
group_has_project("TestGroup", "Community", Gitlab::VisibilityLevel::PUBLIC) group_has_project("TestGroup", "Community", Gitlab::VisibilityLevel::PUBLIC)
end end
step '"John Doe" is owner of group "TestGroup"' do step '"John Doe" is owner of group "TestGroup"' do
group = Group.find_by(name: "TestGroup") || create(:group, name: "TestGroup") group = Group.find_by(name: "TestGroup") || create(:group, name: "TestGroup")
user = create(:user, name: "John Doe") user = create(:user, name: "John Doe")
...@@ -37,31 +37,31 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps ...@@ -37,31 +37,31 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps
step 'I visit group "TestGroup" members page' do step 'I visit group "TestGroup" members page' do
visit members_group_path(Group.find_by(name: "TestGroup")) visit members_group_path(Group.find_by(name: "TestGroup"))
end end
step 'I should not see project "Enterprise" items' do step 'I should not see project "Enterprise" items' do
page.should_not have_content "Enterprise" page.should_not have_content "Enterprise"
end end
step 'I should see project "Internal" items' do step 'I should see project "Internal" items' do
page.should have_content "Internal" page.should have_content "Internal"
end end
step 'I should not see project "Internal" items' do step 'I should not see project "Internal" items' do
page.should_not have_content "Internal" page.should_not have_content "Internal"
end end
step 'I should see project "Community" items' do step 'I should see project "Community" items' do
page.should have_content "Community" page.should have_content "Community"
end end
step 'I change filter to Everyone\'s' do step 'I change filter to Everyone\'s' do
click_link "Everyone's" click_link "Everyone's"
end end
step 'I should see group member "John Doe"' do step 'I should see group member "John Doe"' do
page.should have_content "John Doe" page.should have_content "John Doe"
end end
step 'I should not see member roles' do step 'I should not see member roles' do
page.body.should_not match(%r{owner|developer|reporter|guest}i) page.body.should_not match(%r{owner|developer|reporter|guest}i)
end end
......
class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps class Spinach::Features::ExploreProjectsFeature < Spinach::FeatureSteps
include SharedAuthentication include SharedAuthentication
include SharedPaths include SharedPaths
include SharedProject include SharedProject
......
...@@ -324,7 +324,7 @@ module SharedPaths ...@@ -324,7 +324,7 @@ module SharedPaths
# ---------------------------------------- # ----------------------------------------
step 'I visit the public projects area' do step 'I visit the public projects area' do
visit public_root_path visit explore_projects_path
end end
step 'I visit public page for "Community" project' do step 'I visit public page for "Community" project' do
...@@ -336,7 +336,7 @@ module SharedPaths ...@@ -336,7 +336,7 @@ module SharedPaths
# ---------------------------------------- # ----------------------------------------
step 'I visit the public groups area' do step 'I visit the public groups area' do
visit public_groups_path visit explore_groups_path
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