diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index c841a70..d747c5b 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -232,7 +232,7 @@ class CmsController < MyProfileController begin task.finish unless item[:group].moderated_articles? rescue Exception => ex - @failed[ex.clean_message] ? @failed[ex.clean_message] << item[:group].name : @failed[ex.clean_message] = [item[:group].name] + @failed[ex.message] ? @failed[ex.message] << item[:group].name : @failed[ex.message] = [item[:group].name] end end if @failed.blank? diff --git a/app/controllers/my_profile/tasks_controller.rb b/app/controllers/my_profile/tasks_controller.rb index c52dd97..ac70439 100644 --- a/app/controllers/my_profile/tasks_controller.rb +++ b/app/controllers/my_profile/tasks_controller.rb @@ -27,7 +27,7 @@ class TasksController < MyProfileController task.send(decision) rescue Exception => ex message = "#{task.title} (#{task.requestor ? task.requestor.name : task.author_name})" - failed[ex.clean_message] ? failed[ex.clean_message] << message : failed[ex.clean_message] = [message] + failed[ex.message] ? failed[ex.message] << message : failed[ex.message] = [message] end end end diff --git a/test/functional/catalog_controller_test.rb b/test/functional/catalog_controller_test.rb index 538a220..ed2e7d7 100644 --- a/test/functional/catalog_controller_test.rb +++ b/test/functional/catalog_controller_test.rb @@ -37,7 +37,7 @@ class CatalogControllerTest < ActionController::TestCase should 'list products of enterprise' do get :index, :profile => @enterprise.identifier - assert_kind_of Array, assigns(:products) + assert assigns(:products) end should 'paginate enterprise products list' do diff --git a/test/functional/cms_controller_test.rb b/test/functional/cms_controller_test.rb index d290192..f826ced 100644 --- a/test/functional/cms_controller_test.rb +++ b/test/functional/cms_controller_test.rb @@ -36,7 +36,7 @@ class CmsControllerTest < ActionController::TestCase assert_template 'view' assert_equal profile, assigns(:profile) assert_nil assigns(:article) - assert_kind_of Array, assigns(:articles) + assert assigns(:articles) end should 'be able to view a particular document' do @@ -49,8 +49,6 @@ class CmsControllerTest < ActionController::TestCase assert_template 'view' assert_equal a, assigns(:article) assert_equal [], assigns(:articles) - - assert_kind_of Array, assigns(:articles) end should 'be able to edit a document' do diff --git a/test/functional/friends_controller_test.rb b/test/functional/friends_controller_test.rb index 2553303..e4c0418 100644 --- a/test/functional/friends_controller_test.rb +++ b/test/functional/friends_controller_test.rb @@ -30,7 +30,7 @@ class FriendsControllerTest < ActionController::TestCase get :index assert_response :success assert_template 'index' - assert_kind_of Array, assigns(:friends) + assert assigns(:friends) end should 'confirm removal of friend' do diff --git a/test/functional/memberships_controller_test.rb b/test/functional/memberships_controller_test.rb index a5fe9c4..10289fd 100644 --- a/test/functional/memberships_controller_test.rb +++ b/test/functional/memberships_controller_test.rb @@ -30,7 +30,7 @@ class MembershipsControllerTest < ActionController::TestCase should 'list current memberships' do get :index, :profile => profile.identifier - assert_kind_of Array, assigns(:memberships) + assert assigns(:memberships) end should 'present new community form' do diff --git a/test/functional/profile_controller_test.rb b/test/functional/profile_controller_test.rb index 10a5f90..f1c8f3f 100644 --- a/test/functional/profile_controller_test.rb +++ b/test/functional/profile_controller_test.rb @@ -29,7 +29,7 @@ class ProfileControllerTest < ActionController::TestCase assert_response :success assert_template 'friends' - assert_kind_of Array, assigns(:friends) + assert assigns(:friends) end should 'point to manage friends in user is seeing his own friends' do @@ -50,7 +50,7 @@ class ProfileControllerTest < ActionController::TestCase assert_response :success assert_template 'communities' - assert_kind_of Array, assigns(:communities) + assert assigns(:communities) end should 'list enterprises' do @@ -58,7 +58,7 @@ class ProfileControllerTest < ActionController::TestCase assert_response :success assert_template 'enterprises' - assert_kind_of Array, assigns(:enterprises) + assert assigns(:enterprises) end should 'list members (for organizations)' do @@ -66,7 +66,7 @@ class ProfileControllerTest < ActionController::TestCase assert_response :success assert_template 'members' - assert_kind_of Array, assigns(:members) + assert assigns(:members) end should 'list favorite enterprises' do @@ -74,7 +74,7 @@ class ProfileControllerTest < ActionController::TestCase assert_response :success assert_template 'favorite_enterprises' - assert_kind_of Array, assigns(:favorite_enterprises) + assert assigns(:favorite_enterprises) end should 'not render any template when joining community due to Ajax request' do diff --git a/test/functional/region_validators_controller_test.rb b/test/functional/region_validators_controller_test.rb index 1ea7114..7449ca0 100644 --- a/test/functional/region_validators_controller_test.rb +++ b/test/functional/region_validators_controller_test.rb @@ -26,7 +26,7 @@ class RegionValidatorsControllerTest < ActionController::TestCase get :index assert_response :success assert_template 'index' - assert_kind_of Array, assigns(:regions) + assert assigns(:regions) end should 'view validators for a specific region' do diff --git a/test/functional/tasks_controller_test.rb b/test/functional/tasks_controller_test.rb index 60ee3a8..0b61258 100644 --- a/test/functional/tasks_controller_test.rb +++ b/test/functional/tasks_controller_test.rb @@ -35,7 +35,7 @@ class TasksControllerTest < ActionController::TestCase assert_response :success assert_template 'index' - assert_kind_of Array, assigns(:tasks) + assert assigns(:tasks) end should 'list pending tasks without spam' do @@ -197,7 +197,7 @@ class TasksControllerTest < ActionController::TestCase c = fast_create(Community) c.update_attributes(:moderated_articles => false) @controller.stubs(:profile).returns(c) - folder = create(Article, :profile => c, :name => 'test folder', :type => 'Folder') + folder = create(Folder, :profile => c, :name => 'test folder') c.affiliate(profile, Profile::Roles.all_roles(profile.environment.id)) article = profile.articles.create!(:name => 'something interesting', :body => 'ruby on rails') t = ApproveArticle.create!(:name => 'test name', :article => article, :target => c, :requestor => profile) @@ -275,8 +275,8 @@ class TasksControllerTest < ActionController::TestCase t = SuggestArticle.create!(:article_name => 'test name', :article_abstract => 'test abstract', :article_body => 'test body', :name => 'some name', :email => 'test@localhost.com', :target => c) get :index - assert_tag :tag => 'textarea', :content => 'test abstract', :attributes => { :name => /article_abstract/, :class => 'mceEditor' } - assert_tag :tag => 'textarea', :content => 'test body', :attributes => { :name => /article_body/, :class => 'mceEditor' } + assert_tag :tag => 'textarea', :content => /test abstract/, :attributes => { :name => /article_abstract/, :class => 'mceEditor' } + assert_tag :tag => 'textarea', :content => /test body/, :attributes => { :name => /article_body/, :class => 'mceEditor' } end should 'create TinyMceArticle article after finish approve suggested article task' do -- libgit2 0.21.2