complete project specs

This commit is contained in:
Anton Chuchkalov 2015-12-08 16:35:53 +03:00
parent 2825eee48e
commit a19ca959df
2 changed files with 10 additions and 0 deletions

View File

@ -208,6 +208,7 @@ module Devops
Project.new p
end
# maybe it worth to move components functionality to devops-nibr?
#TODO: create validator
def validate_components
raise InvalidRecord.new "Components is not a hash" unless self.components.is_a?(Hash)

View File

@ -344,6 +344,7 @@ RSpec.describe Devops::Model::Project, type: :model do
end
end
# maybe it worth to move components functionality to devops-nibr?
# describe '#validate_components' do
# it "raises InvalidRecord if one of component doesn't include filename" do
# project.components = {'name' => {}}
@ -351,4 +352,12 @@ RSpec.describe Devops::Model::Project, type: :model do
# end
# end
describe '.create_roles_response' do
it 'returns string' do
expect(described_class.create_roles_response('string')).to be_a(String)
hash = {new: %w(a), exist: %w(b), error: %w(c)}
expect(described_class.create_roles_response(hash)).to be_a(String)
end
end
end