Merge branch 'build-instead-create-in-label-link-spec' into 'master'

Build instead create in label_link model spec

## What does this MR do?
This MR improves spec for label link model.

## Are there points in the code the reviewer needs to double check?
No

## Why was this MR needed?
Because for check validations, we can use build instead create a record in the database. 

## Screenshots (if relevant)
No

## Does this MR meet the acceptance criteria?

- n/a [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- n/a [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- n/a API support added
- Tests
  - n/a Added for this feature/bug
  - [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- n/a [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

See merge request !6792
This commit is contained in:
Dmitriy Zaporozhets 2016-10-11 15:24:19 +00:00
commit 02a4cf4f32

View file

@ -1,8 +1,7 @@
require 'spec_helper'
describe LabelLink, models: true do
let(:label) { create(:label_link) }
it { expect(label).to be_valid }
it { expect(build(:label_link)).to be_valid }
it { is_expected.to belong_to(:label) }
it { is_expected.to belong_to(:target) }