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 4  
5 5 == Unreleased
6 6  
  7 +kalibro_client major update to version 1
  8 +
7 9 == v0.8.0 - 05/08/2015
8 10  
9 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 45 GNU Affero General Public License for more details.
44 46  
45 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 48 \ No newline at end of file
  49 +along with this program. If not, see <http://www.gnu.org/licenses/>.
... ...
Gemfile
... ... @@ -31,7 +31,7 @@ gem &#39;jbuilder&#39;, &#39;~&gt; 2.0&#39;
31 31 gem 'devise', '~> 3.5.1'
32 32  
33 33 # Kalibro integration
34   -gem 'kalibro_client', '~> 0.4.0'
  34 +gem 'kalibro_client', '~> 1.1.0'
35 35  
36 36 # PostgreSQL integration
37 37 gem "pg", "~> 0.18.1"
... ...
Gemfile.lock
... ... @@ -133,7 +133,7 @@ GEM
133 133 railties (>= 3.0.0)
134 134 faraday (0.9.1)
135 135 multipart-post (>= 1.2, < 3)
136   - faraday_middleware (0.9.1)
  136 + faraday_middleware (0.9.2)
137 137 faraday (>= 0.7.4, < 0.10)
138 138 gherkin (2.12.2)
139 139 multi_json (~> 1.3)
... ... @@ -157,7 +157,7 @@ GEM
157 157 jquery-ui-rails (5.0.5)
158 158 railties (>= 3.2.16)
159 159 json (1.8.3)
160   - kalibro_client (0.4.0)
  160 + kalibro_client (1.1.0)
161 161 activesupport (>= 2.2.1)
162 162 faraday_middleware (~> 0.9.0)
163 163 konacha (3.5.1)
... ... @@ -353,7 +353,7 @@ DEPENDENCIES
353 353 jbuilder (~> 2.0)
354 354 jquery-rails
355 355 jquery-ui-rails (~> 5.0.0)
356   - kalibro_client (~> 0.4.0)
  356 + kalibro_client (~> 1.1.0)
357 357 konacha
358 358 mocha
359 359 pg (~> 0.18.1)
... ... @@ -375,3 +375,6 @@ DEPENDENCIES
375 375 twitter-bootstrap-rails!
376 376 uglifier (>= 1.3.0)
377 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 73 # POST /projects/1/repositories/1/state_with_date
74 74 def state_with_date
75 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 78 respond_to_processing_state
79 79 end
... ...
features/step_definitions/repository_steps.rb
... ... @@ -57,19 +57,19 @@ Given(/^I start to process that repository$/) do
57 57 end
58 58  
59 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 61 sleep(10)
62 62 end
63 63 end
64 64  
65 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 67 sleep(10)
68 68 end
69 69 end
70 70  
71 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 73 sleep(10)
74 74 end
75 75 end
... ... @@ -87,7 +87,7 @@ Given(/^I am at repository edit page$/) do
87 87 end
88 88  
89 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 91 end
92 92  
93 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 389 let(:repository) { FactoryGirl.build(:repository) }
390 390  
391 391 before :each do
  392 + repository.expects(:processing_with_date).with("2013-11-11").returns(processing)
392 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 395 xhr :get, :state_with_date, {id: repository.id, day: '11', month: '11', year: '2013'}
396 396 end
... ...