Welcome to mirror list, hosted at ThFree Co, Russian Federation.

evidence_updated_exposed_fields.rb « shared_examples « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2a02fdd7666db1f01dc025506c5304340dd415f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

shared_examples 'updated exposed field' do
  it 'creates another Evidence object' do
    model.send("#{updated_field}=", updated_value)

    expect(model.evidence_summary_keys).to include(updated_field)
    expect { model.save! }.to change(Evidence, :count).by(1)
    expect(updated_json_field).to eq(updated_value)
  end
end

shared_examples 'updated non-exposed field' do
  it 'does not create any Evidence object' do
    model.send("#{updated_field}=", updated_value)

    expect(model.evidence_summary_keys).not_to include(updated_field)
    expect { model.save! }.not_to change(Evidence, :count)
  end
end

shared_examples 'updated field on non-linked entity' do
  it 'does not create any Evidence object' do
    model.send("#{updated_field}=", updated_value)

    expect(model.evidence_summary_keys).to be_empty
    expect { model.save! }.not_to change(Evidence, :count)
  end
end