Skip to content

Commit

Permalink
Avoid stubbing the test subject
Browse files Browse the repository at this point in the history
  • Loading branch information
rzane committed Jan 24, 2025
1 parent 8f7045a commit 9a4279a
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions spec/models/test_track/remote/split_detail_spec.rb
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
require 'rails_helper'

RSpec.describe TestTrack::Remote::SplitDetail do
let(:fake_details) do
{
name: "great_name",
hypothesis: "fake hypothesis",
assignment_criteria: "fake criteria for everyone",
description: "fake but still good description",
owner: "fake owner",
location: "fake activity",
platform: "mobile",
variant_details: [
{
name: "fake first variant detail",
description: "There are FAQ links in a sidebar"
},
{
name: "fake second variant detail",
description: "There are FAQ links in the default footer"
}
]
}
end

before do
stub_request(:get, url)
.with(basic_auth: %w(dummy fakepassword))
Expand All @@ -45,11 +23,9 @@
}
]
}.to_json)

allow(TestTrack::Remote::SplitDetail).to receive(:fake_instance_attributes).with("great_name").and_return(fake_details)
end

describe ".find" do
describe ".find_name" do
let(:url) { "http://testtrack.dev/api/v1/split_details/great_name" }
subject { described_class.from_name("great_name") }

Expand Down

0 comments on commit 9a4279a

Please sign in to comment.