Commit 8e2f02dc74988c3611e17fded12feb452e5da2be

Authored by Rodrigo Souto
1 parent 9132007f

noosfero-steps: fix box fetch on block creation

app/models/environment.rb
@@ -20,7 +20,7 @@ class Environment < ActiveRecord::Base @@ -20,7 +20,7 @@ class Environment < ActiveRecord::Base
20 end 20 end
21 21
22 NUMBER_OF_BOXES = 4 22 NUMBER_OF_BOXES = 4
23 - 23 +
24 PERMISSIONS['Environment'] = { 24 PERMISSIONS['Environment'] = {
25 'view_environment_admin_panel' => N_('View environment admin panel'), 25 'view_environment_admin_panel' => N_('View environment admin panel'),
26 'edit_environment_features' => N_('Edit environment features'), 26 'edit_environment_features' => N_('Edit environment features'),
features/step_definitions/noosfero_steps.rb
@@ -94,8 +94,8 @@ Given /^the following blocks$/ do |table| @@ -94,8 +94,8 @@ Given /^the following blocks$/ do |table|
94 owner.boxes<< Box.new 94 owner.boxes<< Box.new
95 owner.boxes.first.blocks << MainBlock.new 95 owner.boxes.first.blocks << MainBlock.new
96 end 96 end
97 - box_id = owner.boxes.where(:position => [3])  
98 - klass.constantize.create!(item.merge(:box_id => box_id)) 97 + box = owner.boxes.where(:position => 3).first
  98 + klass.constantize.create!(item.merge(:box => box))
99 end 99 end
100 end 100 end
101 101