Commit cb418a4451cf40da7f2411945c456a0bb249fb08
1 parent
19ffa2d9
Exists in
fix_sign_up_form
add functional test
Showing
1 changed file
with
24 additions
and
0 deletions
Show diff stats
plugins/pg_search/test/functional/cms_controller_test.rb
0 → 100644
| @@ -0,0 +1,24 @@ | @@ -0,0 +1,24 @@ | ||
| 1 | +require "test_helper" | ||
| 2 | + | ||
| 3 | +class CmsControllerTest < ActionController::TestCase | ||
| 4 | + | ||
| 5 | + should 'list communities from base profile' do | ||
| 6 | + env = Environment.default | ||
| 7 | + env.enable_plugin(PgSearchPlugin) | ||
| 8 | + profile = create_user('profile').person | ||
| 9 | + login_as(profile.identifier) | ||
| 10 | + | ||
| 11 | + c1 = fast_create(Community, :name => 'Testing community 1', :identifier => 'testcommunity1', :environment_id => env) | ||
| 12 | + c1.add_member profile | ||
| 13 | + c2 = fast_create(Community, :name => 'Testing community 2', :identifier => 'testcommunity2', :environment_id => env) | ||
| 14 | + c2.add_member profile | ||
| 15 | + c2.add_admin profile | ||
| 16 | + | ||
| 17 | + assert_nothing_raised do | ||
| 18 | + get :search_communities_to_publish, :profile => profile.identifier, :q => 'Testing' | ||
| 19 | + end | ||
| 20 | + | ||
| 21 | + assert_match /Testing community 1/, @response.body | ||
| 22 | + assert_match /Testing community 2/, @response.body | ||
| 23 | + end | ||
| 24 | +end |