Add note about RAILS_ENV var in application.yml; fix tests. ✔️

pull/702/head
Rick Carlino 2018-03-07 13:36:01 -06:00
parent d4e1c13bcb
commit 77dd36c228
2 changed files with 12 additions and 6 deletions

View File

@ -95,3 +95,6 @@ EXTRA_DOMAINS: staging.farm.bot,whatever.farm.bot
# ENV below to "true".
# Most users will not want this enabled.
RUN_CAPYBARA: true
# Set this to "production" in most cases.
# If you need help debugging issues, please delete this line.
RAILS_ENV: "production"

View File

@ -1,16 +1,19 @@
import { fakeFbosConfig } from "../../__test_support__/fake_state/resources";
import { fakeFbosConfig, fakeImage } from "../../__test_support__/fake_state/resources";
let mockFbosConfig: TaggedFbosConfig | undefined = fakeFbosConfig();
const mockImages: TaggedImage | undefined = fakeImage();
jest.mock("../../resources/selectors_by_kind", () => ({
getFbosConfig: () => mockFbosConfig
getFbosConfig: () => mockFbosConfig,
selectAllImages: () => [mockImages],
}));
import { mapStateToProps } from "../state_to_props";
import { fakeState } from "../../__test_support__/fake_state";
import { TaggedFbosConfig } from "../../resources/tagged_resources";
import { TaggedFbosConfig, TaggedImage } from "../../resources/tagged_resources";
describe("mapStateToProps()", () => {
it("API source of FBOS settings", () => {
it("is the source of API FBOS settings", () => {
const fakeApiConfig = fakeFbosConfig();
fakeApiConfig.body.auto_sync = true;
fakeApiConfig.body.api_migrated = true;
@ -21,7 +24,7 @@ describe("mapStateToProps()", () => {
});
});
it("bot source of FBOS settings", () => {
it("is the source of bot FBOS settings", () => {
const state = fakeState();
state.bot.hardware.configuration.auto_sync = false;
mockFbosConfig = undefined;
@ -31,7 +34,7 @@ describe("mapStateToProps()", () => {
});
});
it("bot source of FBOS settings: ignore API defaults", () => {
it("is the source of bot FBOS settings: ignore API defaults", () => {
const state = fakeState();
state.bot.hardware.configuration.auto_sync = false;
const fakeApiConfig = fakeFbosConfig();