Skip to content

Commit

Permalink
[ci] Improve Kiwi::Repository#to_xml spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Moises Deniz Aleman committed Jul 24, 2017
1 parent 0d3b6de commit dad61f4
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/api/spec/models/kiwi/repository_spec.rb
Expand Up @@ -83,8 +83,19 @@
end

describe '#to_xml' do
subject { kiwi_repository.to_xml }
context 'without username/password' do
subject { kiwi_repository.to_xml }

it { expect(subject).to eq("<repository type=\"apt-deb\">\n <source path=\"http://example.com/\"/>\n</repository>\n") }
it { expect(subject).to eq("<repository type=\"apt-deb\">\n <source path=\"http://example.com/\"/>\n</repository>\n") }
end

context 'with username/password' do
subject { create(:kiwi_repository, username: 'my_user', password: 'my_password').to_xml }

it do
expect(subject).to eq("<repository type=\"apt-deb\" username=\"my_user\" password=\"my_password\">\n " +
"<source path=\"http://example.com/\"/>\n</repository>\n")
end
end
end
end

0 comments on commit dad61f4

Please sign in to comment.