Skip to content

Commit

Permalink
Stub VERSION const to freeze changes between new versions
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoocasali committed Aug 1, 2022
1 parent 9a0b644 commit 2497d5a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec/configuration_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
require 'spec_helper'

describe MeiliSearch::Rails::Configuration do
before { stub_const('MeiliSearch::Rails::VERSION', '0.0.1') }

let(:configuration) do
{
meilisearch_host: 'http://localhost:7700',
Expand All @@ -21,7 +23,7 @@

expect(MeiliSearch::Client)
.to have_received(:new)
.with('http://localhost:7700', 's3cr3tap1k3y', client_agents: 'Meilisearch Rails (v0.7.0)')
.with('http://localhost:7700', 's3cr3tap1k3y', client_agents: 'Meilisearch Rails (v0.0.1)')
end

context 'without meilisearch_host' do
Expand All @@ -37,7 +39,7 @@

expect(MeiliSearch::Client)
.to have_received(:new)
.with('http://localhost:7700', 's3cr3tap1k3y', { client_agents: 'Meilisearch Rails (v0.7.0)' })
.with('http://localhost:7700', 's3cr3tap1k3y', { client_agents: 'Meilisearch Rails (v0.0.1)' })
end
end

Expand All @@ -56,7 +58,7 @@

expect(MeiliSearch::Client)
.to have_received(:new)
.with('http://localhost:7700', 's3cr3tap1k3y', client_agents: 'Meilisearch Rails (v0.7.0)', timeout: 2, max_retries: 1)
.with('http://localhost:7700', 's3cr3tap1k3y', client_agents: 'Meilisearch Rails (v0.0.1)', timeout: 2, max_retries: 1)
end
end
end
Expand Down

0 comments on commit 2497d5a

Please sign in to comment.