From 152c08963a74eec5051f8e6ed49ae9a8d3bcd923 Mon Sep 17 00:00:00 2001 From: movilla Date: Mon, 12 Aug 2013 16:01:26 +0200 Subject: [PATCH] fix mobile search tags --- Changelog.md | 1 + app/controllers/search_controller.rb | 2 +- app/views/people/index.mobile.haml | 2 +- features/step_definitions/mobile_steps.rb | 4 ++++ features/tags_mobile.feature | 15 +++++++++++++++ 5 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 features/tags_mobile.feature diff --git a/Changelog.md b/Changelog.md index fd2663fc3..2d6e9bfd1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -34,6 +34,7 @@ * Descending text is no longer cut off in orange welcome banner [#4377](https://github.com/diaspora/diaspora/issues/4377) * Adjust Facebook character limit to reality [#4380](https://github.com/diaspora/diaspora/issues/4380) * Restore truncated URLs when posting to Twitter [#4211](https://github.com/diaspora/diaspora/issues/4211) +* Fix mobile search tags [#4392](https://github.com/diaspora/diaspora/issues/4392) ## Features * Admin: add option to find users under 13 (COPPA) [#4252](https://github.com/diaspora/diaspora/pull/4252) diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index cb6802267..cc510215f 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -6,7 +6,7 @@ class SearchController < ApplicationController if search_query.length > 1 respond_to do |format| format.json {redirect_to tags_path(:q => search_query.delete("#."))} - format.html {redirect_to tag_path(:name => search_query.delete("#."))} + format.any {redirect_to tag_path(:name => search_query.delete("#."))} end else flash[:error] = I18n.t('tags.show.none', :name => search_query) diff --git a/app/views/people/index.mobile.haml b/app/views/people/index.mobile.haml index d3aefacdd..d0fd00a4d 100644 --- a/app/views/people/index.mobile.haml +++ b/app/views/people/index.mobile.haml @@ -6,7 +6,7 @@ = t('search') .search-mobile - = form_tag(people_path, :method => 'get') do + = form_tag(search_path, :method => 'get') do %div{:data => {:role => 'fieldcontain', :inline => 'true'}} = search_field_tag :q, nil, :placeholder => t('find_people'), :class => 'search' = submit_tag t('search'), 'data-inline' => 'true', :class => 'btn' diff --git a/features/step_definitions/mobile_steps.rb b/features/step_definitions/mobile_steps.rb index edeaa5d9e..6a84785e1 100644 --- a/features/step_definitions/mobile_steps.rb +++ b/features/step_definitions/mobile_steps.rb @@ -21,3 +21,7 @@ end When /^I visit the mobile getting started page$/ do visit('/getting_started.mobile') end + +When /^I visit the mobile search page$/ do + visit('/people.mobile') +end diff --git a/features/tags_mobile.feature b/features/tags_mobile.feature new file mode 100644 index 000000000..350928997 --- /dev/null +++ b/features/tags_mobile.feature @@ -0,0 +1,15 @@ +@javascript +Feature: Interacting with tags + + Background: + Given a user with username "alice" + And "alice@alice.alice" has a public post with text "Hello! i am #newhere" + When I sign in as "alice@alice.alice" + And I toggle the mobile view + + Scenario: Searching for a tag + When I visit the mobile search page + And I fill in the following: + | q | #newhere | + And I press "Search" + Then I should see "#newhere" within ".ltr"