Commit 6755d9908f95c12fcce422ffcbfc10bda9473104
Exists in
master
and in
4 other branches
Merge pull request #3196 from Undev/feature/broken-projects-search-23049
Broken projects search on dashboard
Showing
6 changed files
with
34 additions
and
5 deletions
Show diff stats
app/controllers/dashboard_controller.rb
app/views/dashboard/_filter.html.haml
1 | 1 | = form_tag dashboard_filter_path(entity), method: 'get' do |
2 | 2 | %fieldset.dashboard-search-filter |
3 | - = search_field_tag "search", params[:search], { placeholder: 'Search', class: 'search-text-input' } | |
3 | + = search_field_tag "search", params[:search], { id: 'filter_search', placeholder: 'Search', class: 'search-text-input' } | |
4 | 4 | = button_tag type: 'submit', class: 'btn' do |
5 | 5 | %i.icon-search |
6 | 6 | ... | ... |
app/views/dashboard/projects.html.haml
... | ... | @@ -24,7 +24,7 @@ |
24 | 24 | = form_tag projects_dashboard_path, method: 'get' do |
25 | 25 | %fieldset.dashboard-search-filter |
26 | 26 | = hidden_field_tag "scope", params[:scope] |
27 | - = search_field_tag "search", params[:search], { placeholder: 'Search', class: 'left input-xxlarge' } | |
27 | + = search_field_tag "search", params[:search], { id: 'dashboard_projects_search', placeholder: 'Search', class: 'left input-xxlarge'} | |
28 | 28 | = button_tag type: 'submit', class: 'btn' do |
29 | 29 | %i.icon-search |
30 | 30 | ... | ... |
features/dashboard/projects.feature
1 | -Feature: Dashboard | |
1 | +Feature: Dashboard projects | |
2 | 2 | Background: |
3 | 3 | Given I sign in as a user |
4 | 4 | And I own project "Shop" |
5 | 5 | And I visit dashboard projects page |
6 | 6 | |
7 | - Scenario: I should see issues list | |
7 | + Scenario: I should see projects list | |
8 | 8 | Then I should see projects list |
9 | + | |
10 | + Scenario: I should see project I am looking for | |
11 | + Given I search for "Sho" | |
12 | + Then I should see "Shop" project link | ... | ... |
... | ... | @@ -0,0 +1,23 @@ |
1 | +class Dashboard < Spinach::FeatureSteps | |
2 | + include SharedAuthentication | |
3 | + include SharedPaths | |
4 | + include SharedProject | |
5 | + | |
6 | + Then 'I should see projects list' do | |
7 | + @user.authorized_projects.all.each do |project| | |
8 | + page.should have_link project.name_with_namespace | |
9 | + end | |
10 | + end | |
11 | + | |
12 | + Given 'I search for "Sho"' do | |
13 | + fill_in "dashboard_projects_search", with: "Sho" | |
14 | + | |
15 | + within ".dashboard-search-filter" do | |
16 | + find('button').click | |
17 | + end | |
18 | + end | |
19 | + | |
20 | + Then 'I should see "Shop" project link' do | |
21 | + page.should have_link "Shop" | |
22 | + end | |
23 | +end | ... | ... |
features/steps/shared/project.rb
... | ... | @@ -9,7 +9,8 @@ module SharedProject |
9 | 9 | |
10 | 10 | # Create a specific project called "Shop" |
11 | 11 | And 'I own project "Shop"' do |
12 | - @project = create(:project, name: "Shop") | |
12 | + @project = Project.find_by_name "Shop" | |
13 | + @project ||= create(:project, name: "Shop") | |
13 | 14 | @project.team << [@user, :master] |
14 | 15 | end |
15 | 16 | ... | ... |