Commit 4f689b2459a093c706d3579ec7db6cd1ea691bba

Authored by Diego Camarinha
Committed by Heitor
1 parent 446e8f02

Fix test that use external connections

Some tests were still trying to access the external servers.

Signed-off-by: Heitor Reis <marcheing@gmail.com>
spec/models/kalibro_configuration_spec.rb
@@ -85,9 +85,9 @@ describe KalibroConfiguration, :type =&gt; :model do @@ -85,9 +85,9 @@ describe KalibroConfiguration, :type =&gt; :model do
85 end 85 end
86 86
87 it 'is expected to clean the attributes memoization' do 87 it 'is expected to clean the attributes memoization' do
88 - pending 'broke after kalibro client major update'  
89 # Call attributes once so it memoizes 88 # Call attributes once so it memoizes
90 KalibroConfigurationAttributes.expects(:find_by).with(kalibro_configuration_id: kalibro_configuration.id).returns(kalibro_configuration_attributes) 89 KalibroConfigurationAttributes.expects(:find_by).with(kalibro_configuration_id: kalibro_configuration.id).returns(kalibro_configuration_attributes)
  90 + KalibroClient::Entities::Configurations::KalibroConfiguration.any_instance.expects(:destroy).returns(kalibro_configuration)
91 expect(kalibro_configuration.attributes).to eq(kalibro_configuration_attributes) 91 expect(kalibro_configuration.attributes).to eq(kalibro_configuration_attributes)
92 92
93 # Destroying 93 # Destroying
spec/models/project_spec.rb
@@ -52,9 +52,9 @@ describe Project, :type =&gt; :model do @@ -52,9 +52,9 @@ describe Project, :type =&gt; :model do
52 end 52 end
53 53
54 it 'is expected to clean the attributes memoization' do 54 it 'is expected to clean the attributes memoization' do
55 - pending 'broke after kalibro client major update'  
56 # Call attributes once so it memoizes 55 # Call attributes once so it memoizes
57 ProjectAttributes.expects(:find_by).with(project_id: project.id).returns(project_attributes) 56 ProjectAttributes.expects(:find_by).with(project_id: project.id).returns(project_attributes)
  57 + KalibroClient::Entities::Processor::Project.any_instance.expects(:destroy).returns(project)
58 expect(project.attributes).to eq(project_attributes) 58 expect(project.attributes).to eq(project_attributes)
59 59
60 # Destroying 60 # Destroying
spec/models/reading_group_spec.rb
@@ -59,9 +59,9 @@ describe ReadingGroup, :type =&gt; :model do @@ -59,9 +59,9 @@ describe ReadingGroup, :type =&gt; :model do
59 end 59 end
60 60
61 it 'is expected to clean the attributes memoization' do 61 it 'is expected to clean the attributes memoization' do
62 - pending 'broke after kalibro client major update'  
63 # Call attributes once so it memoizes 62 # Call attributes once so it memoizes
64 ReadingGroupAttributes.expects(:find_by).with(reading_group_id: reading_group.id).returns(reading_group_attributes) 63 ReadingGroupAttributes.expects(:find_by).with(reading_group_id: reading_group.id).returns(reading_group_attributes)
  64 + KalibroClient::Entities::Configurations::ReadingGroup.any_instance.expects(:destroy).returns(reading_group)
65 expect(reading_group.attributes).to eq(reading_group_attributes) 65 expect(reading_group.attributes).to eq(reading_group_attributes)
66 66
67 # Destroying 67 # Destroying