Commit c8b2ada5997e6eeee76f6a71cff84a9e2601e056
1 parent
a00c09a6
Exists in
colab
and in
4 other branches
Adds coverage for RepositoryAttributes#repository
Also fixes the factory name. Signed off by: Pedro Scocco <pedroscocco@gmail.com>
Showing
2 changed files
with
13 additions
and
1 deletions
Show diff stats
spec/factories/repository_attributes.rb
spec/models/repository_attributes_spec.rb
... | ... | @@ -9,4 +9,16 @@ RSpec.describe RepositoryAttributes, type: :model do |
9 | 9 | describe 'associations' do |
10 | 10 | it { is_expected.to belong_to(:user) } |
11 | 11 | end |
12 | + | |
13 | + describe 'methods' do | |
14 | + describe 'repository' do | |
15 | + subject { FactoryGirl.build(:repository_attributes) } | |
16 | + | |
17 | + it 'is expected to find the repository by id' do | |
18 | + Repository.expects(:find).with(subject.repository_id).returns(subject) | |
19 | + | |
20 | + subject.repository | |
21 | + end | |
22 | + end | |
23 | + end | |
12 | 24 | end | ... | ... |