How can I test different app configurations in Rails?

I have an model whose behavior should change slightly based on a configuration file. The configuration file, in theory, will be altered for each installation of the app for my clients. So how can I test for these changes?

For example...

# in app/models/person.rb  before_save automatically_make_person_contributer if Rails.configuration.x.people['are_contributers_by_default']    # in test/models/person_test.rb  test "auto-assigns role if it should" do   # this next line doesn't actually work when the Person#before_save runs...   Rails.configuration.x.people['are_contributers_by_default'] = true end  test "won't auto assign a role if it shouldn't" do   # this next line doesn't actually work when the Person#before_save runs...   Rails.configuration.x.people['are_contributers_by_default'] = false end 

It doesn't make sense for these to be stored in the database, because they are one time configurations, but I need to make sure my app behaves under all the possible configurations in all environments.

Replay

Category: ruby on rails Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.243 (s). 12 q(s)