Skip to content

Commit

Permalink
Add encrypted token so travis can run the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Moncef Belyamani committed Nov 13, 2013
1 parent d26d1ec commit 0cfa2aa
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
24 changes: 13 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
language: ruby

rvm:
- 2.0.0

- 2.0.0
services:
- mongodb
- redis-server
- elasticsearch

- mongodb
- redis-server
- elasticsearch
before_script:
- rake db:mongoid:create_indexes

- rake db:mongoid:create_indexes
notifications:
campfire:
rooms:
- secure: "eEuzoYFXLPeIMt+zHGzZp6XCvbfxRDe8FA3kVwrNRB0zoOktPRZXD9O8ng2z\nx2Yg8C7i1unstuW0bjPvwphpdxJOTFSxliw6P4Xk1Y9HnTYQqqUbDat/zL9c\nAyjYezuRQgYFSBP2BgNZ2RL9RiLSyLQBWhcHGB0yBS6rsheKWbk="
- secure: |-
eEuzoYFXLPeIMt+zHGzZp6XCvbfxRDe8FA3kVwrNRB0zoOktPRZXD9O8ng2z
x2Yg8C7i1unstuW0bjPvwphpdxJOTFSxliw6P4Xk1Y9HnTYQqqUbDat/zL9c
AyjYezuRQgYFSBP2BgNZ2RL9RiLSyLQBWhcHGB0yBS6rsheKWbk=
on_success: never
on_failure: always
webhooks: http://cfa-project-monitor.herokuapp.com/projects/f4e235b6-734e-4d63-a19b-32426335c047/status
webhooks: http://cfa-project-monitor.herokuapp.com/projects/f4e235b6-734e-4d63-a19b-32426335c047/status
env:
matrix:
secure: SyAQm64busWPLwPPdpebaH3QIaK7acP8j7eIj449kI+KYSkTEj5G+ir/Nu1z0XLGv50vmezdg8FsKBe32Bi5c5f1I5rRLsTI9K/lN10OYh6ZzERoTTsypjx+s9xQ1NRPzamMGEpcxG2iOU/n2KU3CPW4BPIp9dpmhUFZ3Obk71Q=
10 changes: 10 additions & 0 deletions spec/api/locations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -555,5 +555,15 @@
end
end

describe "Update a location without a valid token" do
it "doesn't allow updating a location witout a valid token" do
@loc = create(:location)
put "api/locations/#{@loc.id}", { :name => "new name" },
{ 'HTTP_X_API_TOKEN' => "invalid_token" }
@loc.reload
expect(response.status).to eq(401)
end
end

end
end
9 changes: 9 additions & 0 deletions spec/api/services_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,16 @@
expect(response.status).to eq(400)
json["message"].should include "Service areas must be an array"
end
end

describe "Update a service without a valid token" do
it "doesn't allow updating a service witout a valid token" do
service = create(:service)
put "api/services/#{service.id}", { :name => "new name" },
{ 'HTTP_X_API_TOKEN' => "invalid_token" }
service.reload
expect(response.status).to eq(401)
end
end

end
Expand Down

0 comments on commit 0cfa2aa

Please sign in to comment.