forked from External/greenlight
GRN2-134: Added Color Input for lighten and darken (#529)
* Added Color Input for lighten and darken * rspec
This commit is contained in:
committed by
Jesus Federico
parent
1a5cecc0c5
commit
9638ebcbc5
@ -185,7 +185,7 @@ describe AdminsController, type: :controller do
|
||||
allow_any_instance_of(User).to receive(:greenlight_account?).and_return(true)
|
||||
|
||||
@request.session[:user_id] = @admin.id
|
||||
primary_color = "#000000"
|
||||
primary_color = Faker::Color.hex_color
|
||||
|
||||
post :coloring, params: { color: primary_color }
|
||||
|
||||
@ -194,6 +194,36 @@ describe AdminsController, type: :controller do
|
||||
expect(feature[:value]).to eq(primary_color)
|
||||
expect(response).to redirect_to(admins_path)
|
||||
end
|
||||
|
||||
it "changes the primary-lighten on the page" do
|
||||
allow(Rails.configuration).to receive(:loadbalanced_configuration).and_return(true)
|
||||
allow_any_instance_of(User).to receive(:greenlight_account?).and_return(true)
|
||||
|
||||
@request.session[:user_id] = @admin.id
|
||||
primary_color = Faker::Color.hex_color
|
||||
|
||||
post :coloring_lighten, params: { color: primary_color }
|
||||
|
||||
feature = Setting.find_by(provider: "provider1").features.find_by(name: "Primary Color Lighten")
|
||||
|
||||
expect(feature[:value]).to eq(primary_color)
|
||||
expect(response).to redirect_to(admins_path)
|
||||
end
|
||||
|
||||
it "changes the primary-darken on the page" do
|
||||
allow(Rails.configuration).to receive(:loadbalanced_configuration).and_return(true)
|
||||
allow_any_instance_of(User).to receive(:greenlight_account?).and_return(true)
|
||||
|
||||
@request.session[:user_id] = @admin.id
|
||||
primary_color = Faker::Color.hex_color
|
||||
|
||||
post :coloring_darken, params: { color: primary_color }
|
||||
|
||||
feature = Setting.find_by(provider: "provider1").features.find_by(name: "Primary Color Darken")
|
||||
|
||||
expect(feature[:value]).to eq(primary_color)
|
||||
expect(response).to redirect_to(admins_path)
|
||||
end
|
||||
end
|
||||
|
||||
context "POST #registration_method" do
|
||||
|
Reference in New Issue
Block a user