Commit c5e2e84a authored by Alper Akgun's avatar Alper Akgun

Improve trial controller specs

parent f049b19c
...@@ -139,7 +139,7 @@ RSpec.describe TrialsController do ...@@ -139,7 +139,7 @@ RSpec.describe TrialsController do
post_create_lead post_create_lead
end end
it "tracks for the combined_registration experiment" do it 'tracks for the combined_registration experiment' do
expect(experiment(:combined_registration)).to track(:create_trial).on_next_instance expect(experiment(:combined_registration)).to track(:create_trial).on_next_instance
post_create_lead post_create_lead
...@@ -170,7 +170,7 @@ RSpec.describe TrialsController do ...@@ -170,7 +170,7 @@ RSpec.describe TrialsController do
first_name: user.first_name, first_name: user.first_name,
last_name: user.last_name, last_name: user.last_name,
phone_number: '1111111111', phone_number: '1111111111',
number_of_users: "20", number_of_users: '20',
country: 'IN' country: 'IN'
} }
end end
...@@ -447,7 +447,7 @@ RSpec.describe TrialsController do ...@@ -447,7 +447,7 @@ RSpec.describe TrialsController do
end end
end end
it "calls the ApplyTrialService with correct parameters" do it 'calls the ApplyTrialService with correct parameters' do
gl_com_params = { gitlab_com_trial: true, sync_to_gl: true } gl_com_params = { gitlab_com_trial: true, sync_to_gl: true }
post_params = { post_params = {
namespace_id: namespace.id.to_s, namespace_id: namespace.id.to_s,
...@@ -511,7 +511,7 @@ RSpec.describe TrialsController do ...@@ -511,7 +511,7 @@ RSpec.describe TrialsController do
end end
context 'when cannot find the namespace' do context 'when cannot find the namespace' do
let(:namespace_id) { 'invalid-namespace-id' } let(:namespace_id) { non_existing_record_id.to_s }
it 'returns 404' do it 'returns 404' do
is_expected.to have_gitlab_http_status(:not_found) is_expected.to have_gitlab_http_status(:not_found)
...@@ -555,7 +555,7 @@ RSpec.describe TrialsController do ...@@ -555,7 +555,7 @@ RSpec.describe TrialsController do
end end
end end
it "calls the ExtendReactivateTrialService with correct parameters" do it 'calls the ExtendReactivateTrialService with correct parameters' do
gl_com_params = { gitlab_com_trial: true } gl_com_params = { gitlab_com_trial: true }
put_params = { put_params = {
namespace_id: namespace.id.to_s, namespace_id: namespace.id.to_s,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment