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