Skip to content

Commit

Permalink
more doc and fix env issue
Browse files Browse the repository at this point in the history
  • Loading branch information
goenning committed May 3, 2017
1 parent 8be3c00 commit 08960ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ Step by step:
7) Navigate to `http://demo.dev.canhearyou.com:3000/` and boom! Welcome to your new local WeCanHearYou development copy!

Change some code, fix some bugs, implement some features and send us your Pull Request!

# How to run the tests

1) run `docker-compose up -d pgtest` to start a test-only PostgreSQL database on Docker.
2) run `make test`.
9 changes: 0 additions & 9 deletions app/pkg/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ func CurrentDomain() string {
return "test.canhearyou.com"
case "development":
return "dev.canhearyou.com"
case "staging":
return "staging.canhearyou.com"
}
return "canhearyou.com"

Expand All @@ -51,8 +49,6 @@ func Current() string {
switch env {
case "test":
return "test"
case "staging":
return "staging"
case "production":
return "production"
}
Expand All @@ -64,11 +60,6 @@ func IsProduction() bool {
return Current() == "production"
}

// IsStaging returns true on Wechy staging environment
func IsStaging() bool {
return Current() == "staging"
}

// IsTest returns true on Wechy test environment
func IsTest() bool {
return Current() == "test"
Expand Down
3 changes: 1 addition & 2 deletions app/pkg/env/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ var envs = []struct {
isEnv func() bool
}{
{"test", "test.canhearyou.com", "test", env.IsTest},
{"staging", "staging.canhearyou.com", "staging", env.IsStaging},
{"development", "dev.canhearyou.com", "development", env.IsDevelopment},
{"production", "canhearyou.com", "production", env.IsProduction},
{"anything", "canhearyou.com", "development", env.IsDevelopment},
{"anything", "dev.canhearyou.com", "development", env.IsDevelopment},
}

func TestGetEnvOrDefault(t *testing.T) {
Expand Down

0 comments on commit 08960ca

Please sign in to comment.