Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleResult#history_of request is broken #62

Open
diegoamc opened this issue Aug 4, 2015 · 4 comments
Open

ModuleResult#history_of request is broken #62

diegoamc opened this issue Aug 4, 2015 · 4 comments

Comments

@diegoamc
Copy link
Contributor

diegoamc commented Aug 4, 2015

KalibroProcessor returns a hash with the key module_result_history_of as you can see here.
Currently, KalibroClient is trying to access the key date_module_results.

@marcosddourado
Copy link

Which key is the best one to use?

@marcosddourado
Copy link

We have tested the module_result class on the KalibroClient project and it is not crashing. How to force this error?

@diegoamc
Copy link
Contributor Author

@marcosddourado, can you provide details of how you've tested it?

@marcosddourado
Copy link

We didn't think that we had to create a test, just modify the used one. like this:

   before :each do
      KalibroClient::Entities::Processor::Repository.
        expects(:request).
        with(':id/module_result_history_of', {id: repository.id, kalibro_module_id: subject.kalibro_module.id}).
        returns({'module_result_history_of' => [[date_module_result.date, date_module_result.module_result.to_hash]]})
    end

    it 'should return a list of date_module_results' do
      date_module_results = KalibroClient::Entities::Processor::ModuleResult.history_of(subject, repository.id)
      expect(date_module_results.first.result).to eq date_module_result.result
    end

As you can we fixed the hashes by getting the value with the right key(module_result_history_of)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants