From cb418a4451cf40da7f2411945c456a0bb249fb08 Mon Sep 17 00:00:00 2001 From: Marcelo JĂșnior Date: Fri, 22 Jul 2016 21:08:03 +0000 Subject: [PATCH] add functional test --- plugins/pg_search/test/functional/cms_controller_test.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+), 0 deletions(-) create mode 100644 plugins/pg_search/test/functional/cms_controller_test.rb diff --git a/plugins/pg_search/test/functional/cms_controller_test.rb b/plugins/pg_search/test/functional/cms_controller_test.rb new file mode 100644 index 0000000..d643023 --- /dev/null +++ b/plugins/pg_search/test/functional/cms_controller_test.rb @@ -0,0 +1,24 @@ +require "test_helper" + +class CmsControllerTest < ActionController::TestCase + + should 'list communities from base profile' do + env = Environment.default + env.enable_plugin(PgSearchPlugin) + profile = create_user('profile').person + login_as(profile.identifier) + + c1 = fast_create(Community, :name => 'Testing community 1', :identifier => 'testcommunity1', :environment_id => env) + c1.add_member profile + c2 = fast_create(Community, :name => 'Testing community 2', :identifier => 'testcommunity2', :environment_id => env) + c2.add_member profile + c2.add_admin profile + + assert_nothing_raised do + get :search_communities_to_publish, :profile => profile.identifier, :q => 'Testing' + end + + assert_match /Testing community 1/, @response.body + assert_match /Testing community 2/, @response.body + end +end -- libgit2 0.21.2