Commit f4de524679539ed1781d679e5ab28aabacf8f970

Authored by Diego Camarinha
2 parents c6beeec4 ce5df82a

Merge pull request #252 from mezuro/kalibro_client_update

Kalibro client update
CHANGELOG.rdoc
@@ -4,6 +4,8 @@ Prezento is the web interface for Mezuro. @@ -4,6 +4,8 @@ Prezento is the web interface for Mezuro.
4 4
5 == Unreleased 5 == Unreleased
6 6
  7 +kalibro_client major update to version 1
  8 +
7 == v0.8.0 - 05/08/2015 9 == v0.8.0 - 05/08/2015
8 10
9 Travis build reliability improved by disabling jQuery on acceptance tests 11 Travis build reliability improved by disabling jQuery on acceptance tests
@@ -43,4 +45,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -43,4 +45,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43 GNU Affero General Public License for more details. 45 GNU Affero General Public License for more details.
44 46
45 You should have received a copy of the GNU Affero General Public License 47 You should have received a copy of the GNU Affero General Public License
46 -along with this program. If not, see <http://www.gnu.org/licenses/>.  
47 \ No newline at end of file 48 \ No newline at end of file
  49 +along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -31,7 +31,7 @@ gem &#39;jbuilder&#39;, &#39;~&gt; 2.0&#39; @@ -31,7 +31,7 @@ gem &#39;jbuilder&#39;, &#39;~&gt; 2.0&#39;
31 gem 'devise', '~> 3.5.1' 31 gem 'devise', '~> 3.5.1'
32 32
33 # Kalibro integration 33 # Kalibro integration
34 -gem 'kalibro_client', '~> 0.4.0' 34 +gem 'kalibro_client', '~> 1.1.0'
35 35
36 # PostgreSQL integration 36 # PostgreSQL integration
37 gem "pg", "~> 0.18.1" 37 gem "pg", "~> 0.18.1"
@@ -133,7 +133,7 @@ GEM @@ -133,7 +133,7 @@ GEM
133 railties (>= 3.0.0) 133 railties (>= 3.0.0)
134 faraday (0.9.1) 134 faraday (0.9.1)
135 multipart-post (>= 1.2, < 3) 135 multipart-post (>= 1.2, < 3)
136 - faraday_middleware (0.9.1) 136 + faraday_middleware (0.9.2)
137 faraday (>= 0.7.4, < 0.10) 137 faraday (>= 0.7.4, < 0.10)
138 gherkin (2.12.2) 138 gherkin (2.12.2)
139 multi_json (~> 1.3) 139 multi_json (~> 1.3)
@@ -157,7 +157,7 @@ GEM @@ -157,7 +157,7 @@ GEM
157 jquery-ui-rails (5.0.5) 157 jquery-ui-rails (5.0.5)
158 railties (>= 3.2.16) 158 railties (>= 3.2.16)
159 json (1.8.3) 159 json (1.8.3)
160 - kalibro_client (0.4.0) 160 + kalibro_client (1.1.0)
161 activesupport (>= 2.2.1) 161 activesupport (>= 2.2.1)
162 faraday_middleware (~> 0.9.0) 162 faraday_middleware (~> 0.9.0)
163 konacha (3.5.1) 163 konacha (3.5.1)
@@ -353,7 +353,7 @@ DEPENDENCIES @@ -353,7 +353,7 @@ DEPENDENCIES
353 jbuilder (~> 2.0) 353 jbuilder (~> 2.0)
354 jquery-rails 354 jquery-rails
355 jquery-ui-rails (~> 5.0.0) 355 jquery-ui-rails (~> 5.0.0)
356 - kalibro_client (~> 0.4.0) 356 + kalibro_client (~> 1.1.0)
357 konacha 357 konacha
358 mocha 358 mocha
359 pg (~> 0.18.1) 359 pg (~> 0.18.1)
@@ -375,3 +375,6 @@ DEPENDENCIES @@ -375,3 +375,6 @@ DEPENDENCIES
375 twitter-bootstrap-rails! 375 twitter-bootstrap-rails!
376 uglifier (>= 1.3.0) 376 uglifier (>= 1.3.0)
377 web-console (~> 2.0.0) 377 web-console (~> 2.0.0)
  378 +
  379 +BUNDLED WITH
  380 + 1.10.5
app/controllers/repositories_controller.rb
@@ -73,7 +73,7 @@ class RepositoriesController &lt; ApplicationController @@ -73,7 +73,7 @@ class RepositoriesController &lt; ApplicationController
73 # POST /projects/1/repositories/1/state_with_date 73 # POST /projects/1/repositories/1/state_with_date
74 def state_with_date 74 def state_with_date
75 year, month, day = params[:year], params[:month], params[:day] 75 year, month, day = params[:year], params[:month], params[:day]
76 - @processing = Processing.processing_with_date_of(@repository.id, "#{year}-#{month}-#{day}") 76 + @processing = @repository.processing_with_date("#{year}-#{month}-#{day}")
77 77
78 respond_to_processing_state 78 respond_to_processing_state
79 end 79 end
features/step_definitions/repository_steps.rb
@@ -57,19 +57,19 @@ Given(/^I start to process that repository$/) do @@ -57,19 +57,19 @@ Given(/^I start to process that repository$/) do
57 end 57 end
58 58
59 Given(/^I wait up for a ready processing$/) do 59 Given(/^I wait up for a ready processing$/) do
60 - while !Processing.has_ready_processing(@repository.id) 60 + while !@repository.has_ready_processing
61 sleep(10) 61 sleep(10)
62 end 62 end
63 end 63 end
64 64
65 Given(/^I wait up for the last processing to get ready$/) do 65 Given(/^I wait up for the last processing to get ready$/) do
66 - while Processing.last_processing_of(@repository.id).state != "READY" 66 + while @repository.last_processing.state != "READY"
67 sleep(10) 67 sleep(10)
68 end 68 end
69 end 69 end
70 70
71 Given(/^I wait up for a error processing$/) do 71 Given(/^I wait up for a error processing$/) do
72 - while Processing.last_processing_state_of(@repository.id) != "ERROR" 72 + while @repository.last_processing_state != "ERROR"
73 sleep(10) 73 sleep(10)
74 end 74 end
75 end 75 end
@@ -87,7 +87,7 @@ Given(/^I am at repository edit page$/) do @@ -87,7 +87,7 @@ Given(/^I am at repository edit page$/) do
87 end 87 end
88 88
89 Given(/^I ask for the last ready processing of the given repository$/) do 89 Given(/^I ask for the last ready processing of the given repository$/) do
90 - @processing = Processing.last_ready_processing_of @repository.id 90 + @processing = @repository.last_ready_processing
91 end 91 end
92 92
93 Given(/^I ask for the module result of the given processing$/) do 93 Given(/^I ask for the module result of the given processing$/) do
spec/controllers/repositories_controller_spec.rb
@@ -389,8 +389,8 @@ describe RepositoriesController, :type =&gt; :controller do @@ -389,8 +389,8 @@ describe RepositoriesController, :type =&gt; :controller do
389 let(:repository) { FactoryGirl.build(:repository) } 389 let(:repository) { FactoryGirl.build(:repository) }
390 390
391 before :each do 391 before :each do
  392 + repository.expects(:processing_with_date).with("2013-11-11").returns(processing)
392 Repository.expects(:find).at_least_once.with(repository.id).returns(repository) 393 Repository.expects(:find).at_least_once.with(repository.id).returns(repository)
393 - Processing.expects(:processing_with_date_of).with(repository.id, "2013-11-11").returns(processing)  
394 394
395 xhr :get, :state_with_date, {id: repository.id, day: '11', month: '11', year: '2013'} 395 xhr :get, :state_with_date, {id: repository.id, day: '11', month: '11', year: '2013'}
396 end 396 end