[Git][noosfero/noosfero][rails4] 3 commits: travis: use ruby 2.2.3

Bráulio Bhavamitra gitlab at gitlab.com
Sat Aug 29 08:46:15 BRT 2015


Bráulio Bhavamitra pushed to branch rails4 at Noosfero / noosfero


Commits:
b93de569 by Braulio Bhavamitra at 2015-08-29T08:09:39Z
travis: use ruby 2.2.3

- - - - -
1e78417c by Braulio Bhavamitra at 2015-08-29T08:18:13Z
rails4: fix remaining unit and functionals tests

- - - - -
3ce06577 by Braulio Bhavamitra at 2015-08-29T08:45:16Z
rails4: fix layout disable

- - - - -


5 changed files:

- .travis.yml
- app/controllers/application_controller.rb
- test/functional/search_controller_test.rb
- test/unit/person_notifier_test.rb
- test/unit/scrap_test.rb


Changes:

=====================================
.travis.yml
=====================================
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,6 @@
 language: ruby
 rvm:
-# for 2.2 support we need to upgrade the pg gem
-  - 2.1.6
+  - 2.2.3
 
 sudo: false
 addons:
@@ -18,9 +17,6 @@ addons:
       - libsqlite3-dev
       - libxslt1-dev
 
-before_install:
-  - gem env
-
 # workaround for https://github.com/travis-ci/travis-ci/issues/4536
 before_install:
   - export GEM_HOME=$PWD/vendor/bundle/ruby/2.1.0


=====================================
app/controllers/application_controller.rb
=====================================
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -41,7 +41,7 @@ class ApplicationController < ActionController::Base
   include ApplicationHelper
   layout :get_layout
   def get_layout
-    return nil if request.format == :js or request.xhr?
+    return false if request.format == :js or request.xhr?
 
     theme_layout = theme_option(:layout)
     if theme_layout


=====================================
test/functional/search_controller_test.rb
=====================================
--- a/test/functional/search_controller_test.rb
+++ b/test/functional/search_controller_test.rb
@@ -316,7 +316,7 @@ class SearchControllerTest < ActionController::TestCase
     ev1 = create_event(person, :name => 'event 1', :category_ids => [@category.id],  :start_date => ten_days_ago)
     ev2 = create_event(person, :name => 'event 2', :category_ids => [@category.id],  :start_date => DateTime.now - 2.month)
 
-    get :events, day: ten_days_ago.day+1.second, month: ten_days_ago.month, year: ten_days_ago.year
+    get :events, day: ten_days_ago.day, month: ten_days_ago.month, year: ten_days_ago.year
     assert_equal [ev1], assigns(:events)
   end
 
@@ -329,7 +329,7 @@ class SearchControllerTest < ActionController::TestCase
 
     ev2 = create_event(person, :name => 'event 2', :start_date => ten_days_ago)
 
-    get :events, day: ten_days_ago.day+1.second, month: ten_days_ago.month, year: ten_days_ago.year, category_path: @category.path.split('/')
+    get :events, day: ten_days_ago.day, month: ten_days_ago.month, year: ten_days_ago.year, category_path: @category.path.split('/')
 
     assert_equal [ev1], assigns(:events)
   end


=====================================
test/unit/person_notifier_test.rb
=====================================
--- a/test/unit/person_notifier_test.rb
+++ b/test/unit/person_notifier_test.rb
@@ -48,6 +48,8 @@ class PersonNotifierTest < ActiveSupport::TestCase
 
   should 'display author name in delivered mail' do
     @community.add_member(@member)
+    ActionMailer::Base.deliveries.clear
+
     Comment.create!(:author => @admin, :title => 'test comment', :body => 'body!', :source => @article)
     process_delayed_job_queue
     notify


=====================================
test/unit/scrap_test.rb
=====================================
--- a/test/unit/scrap_test.rb
+++ b/test/unit/scrap_test.rb
@@ -88,7 +88,8 @@ class ScrapTest < ActiveSupport::TestCase
   end
 
   should "create the leave_scrap action tracker verb on scrap creation of one user to another" do
-    p1 = create_user.person
+    User.current = create_user
+    p1 = User.current.person
     p2 = create_user.person
     s = Scrap.new
     s.sender= p1
@@ -105,7 +106,8 @@ class ScrapTest < ActiveSupport::TestCase
   end
 
   should "create the leave_scrap action tracker verb on scrap creation of one user to community" do
-    p = create_user.person
+    User.current = create_user
+    p = User.current.person
     c = fast_create(Community)
     s = Scrap.new
     s.sender= p
@@ -163,7 +165,8 @@ class ScrapTest < ActiveSupport::TestCase
   end
 
   should "create the leave_scrap_to_self action tracker verb on scrap creation of one user to itself" do
-    p = create_user.person
+    User.current = create_user
+    p = User.current.person
     s = Scrap.new
     s.sender= p
     s.receiver= p



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/8548bd8a82b1356435f76c34560a5e8a3c6d3aa1...3ce06577b3b34b0e7973c33576cbeae560c62592
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150829/1818ed75/attachment.html>


More information about the Noosfero-dev mailing list