add missing spec for Server.build_from_bson method
This commit is contained in:
parent
33b460d50b
commit
f46feedcbe
@ -44,6 +44,14 @@ RSpec.describe Devops::Model::Server, type: :model do
|
||||
end
|
||||
end
|
||||
|
||||
describe '.build_from_bson' do
|
||||
it 'takes a hash and returns instance of Server model' do
|
||||
model = described_class.build_from_bson('id' => 'foo')
|
||||
expect(model).to be_an_instance_of(described_class)
|
||||
expect(model.id).to eq 'foo'
|
||||
end
|
||||
end
|
||||
|
||||
it '#to_hash_without_id returns not nil fields' do
|
||||
server = described_class.new('run_list' => [], 'project' => 'asd')
|
||||
expect(server.to_hash_without_id.keys).to match_array(%w(run_list project))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user