* Add RailsEnvConstraint for routes * Add feature flags API * Add Cypress commands * Add show action, update commands, add e2e test * Update cypress/integration/seededFlows/toggleFeatureFlags.spec.js Co-authored-by: Suzanne Aitchison <suzanne@forem.com> * Move helper from command to test file * Update documentation Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
13 lines
431 B
Ruby
13 lines
431 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe RailsEnvConstraint, type: :lib do
|
|
it "matches only in the correct environments", :aggregate_failures do
|
|
constraint = described_class.new(allowed_envs: %w[development])
|
|
|
|
allow(Rails).to receive(:env).and_return("development")
|
|
expect(constraint.matches?).to be true
|
|
|
|
allow(Rails).to receive(:env).and_return("production")
|
|
expect(constraint.matches?).to be false
|
|
end
|
|
end
|