|
4 | 4 | describe 'GET /api/v1/split_details/:id' do |
5 | 5 | let(:default_app) { FactoryGirl.create :app, name: "default_app", auth_secret: "6Sd6T7T6Q8hKcoo0t8CTzV0IdN1EEHqXB2Ig4raZsOf" } |
6 | 6 | let(:split_with_no_details) { FactoryGirl.create :split, name: "fantastic_split" } |
7 | | - let(:split_with_details) { FactoryGirl.create :split, name: "fantastic_split_with_information", platform: 'mobile', description: 'Greatest Split', assignment_criteria: "Must love problem solvers", hypothesis: 'Will solve all problems', location: 'Everywhere', owner: 'Me' } # rubocop:disable Metrics/LineLength |
| 7 | + let(:split_with_details) { FactoryGirl.create :split, registry: { enabled: 99, disabled: 1 }, name: "fantastic_split_with_information", platform: 'mobile', description: 'Greatest Split', assignment_criteria: "Must love problem solvers", hypothesis: 'Will solve all problems', location: 'Everywhere', owner: 'Me' } # rubocop:disable Metrics/LineLength |
| 8 | + |
| 9 | + let!(:variant_detail_a) do |
| 10 | + FactoryGirl.create( |
| 11 | + :variant_detail, |
| 12 | + split: split_with_details, |
| 13 | + variant: 'enabled', |
| 14 | + display_name: 'fantastic_split_with_information is on', |
| 15 | + description: 'This awesome feature makes cool stuff happen.' |
| 16 | + ) |
| 17 | + end |
| 18 | + let!(:variant_detail_b) do |
| 19 | + FactoryGirl.create( |
| 20 | + :variant_detail, |
| 21 | + split: split_with_details, |
| 22 | + variant: 'disabled', |
| 23 | + display_name: 'fantastic_split_with_information is off', |
| 24 | + description: 'This feature makes nothing happen.' |
| 25 | + ) |
| 26 | + end |
8 | 27 |
|
9 | 28 | before do |
10 | 29 | http_authenticate username: default_app.name, password: default_app.auth_secret |
|
20 | 39 | "assignment_criteria" => nil, |
21 | 40 | "platform" => nil, |
22 | 41 | "description" => nil, |
23 | | - "owner" => nil |
| 42 | + "owner" => nil, |
| 43 | + "variant_details" => [] |
24 | 44 | ) |
25 | 45 | end |
26 | 46 |
|
|
34 | 54 | "assignment_criteria" => split_with_details.assignment_criteria, |
35 | 55 | "platform" => split_with_details.platform, |
36 | 56 | "description" => split_with_details.description, |
37 | | - "owner" => split_with_details.owner |
| 57 | + "owner" => split_with_details.owner, |
| 58 | + "variant_details" => [ |
| 59 | + { |
| 60 | + "name" => "fantastic_split_with_information is on", |
| 61 | + "description" => 'This awesome feature makes cool stuff happen.' |
| 62 | + }, |
| 63 | + { |
| 64 | + "name" => "fantastic_split_with_information is off", |
| 65 | + "description" => "This feature makes nothing happen." |
| 66 | + } |
| 67 | + ] |
38 | 68 | ) |
39 | 69 | end |
40 | 70 |
|
|
0 commit comments