* Add HTML variants for cta optimization and other nav bar adjustments * Fix 1==1 non-random mistake * Spruce up org call-to-action * Change default text color * Add html variant trial and success request specs * Fix article sidebar caching issue * One line adjustment * Modify schema * Add include ActionView::Helpers::TagHelper to user_tag_spec * Modify follow_button to remove session context * Dummy commit * Change Edit Article to Edit Post * Dummy commit * Fix rubocop concerns * Fix rubocop style
25 lines
620 B
Ruby
25 lines
620 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe "HtmlVariantTrials", type: :request do
|
|
let(:user) { create(:user) }
|
|
let(:article) { create(:article, user_id: user.id, approved: true) }
|
|
let(:html_variant) { create(:html_variant) }
|
|
|
|
before do
|
|
Delayed::Worker.delay_jobs = false
|
|
end
|
|
|
|
after do
|
|
Delayed::Worker.delay_jobs = true
|
|
end
|
|
|
|
describe "POST /html_variant_trials" do
|
|
it "rejects non-permissioned user" do
|
|
post "/html_variant_trials", params: {
|
|
article_id: article.id,
|
|
html_variant_id: html_variant.id,
|
|
}
|
|
expect(HtmlVariantTrial.all.size).to eq(1)
|
|
end
|
|
end
|
|
end
|