提交 02a4cf4f 编写于 作者: D Dmitriy Zaporozhets

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
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) }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册