fastly-rails 0.1.7 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 74b28d38647aac532db31075481ea16ce28e0b81
4
- data.tar.gz: 1e7d7eb3d59633c53aa18d9ad86e4c5aec56a1f6
3
+ metadata.gz: 8918d904c0624fdf6caab3e74b1eb248faba565e
4
+ data.tar.gz: c6a42d20c196a1e7f4bb5ec2da05a287a5eb9a6e
5
5
  SHA512:
6
- metadata.gz: d6194c8d8d470e8299c55d29b9bcd798f071858826f6bd181691fb11dd2b3a93235727a1909a6447feb2954ccc5787f7395c0aaabedb3d0ce2ebc88ae762fd25
7
- data.tar.gz: a4b5b40a6aa4d0214e02ada29debda923f82bb1f89002b47fdc851c88bb1bce89c8b710c11dab24a7feaa3338eeba2bc55dbb6966279a85536f4ac9ab0d1a424
6
+ metadata.gz: 040273cea894f45524934a15f6dd0efe5f04448eb938b9bf75e14a3488acf53d7dbae67eab2fb2da505a23517d021265678949d1bd6f9a9028c5102348ef091e
7
+ data.tar.gz: 9b6646a08090ed4b76f00b6f5ea78d56ac9bb561c67409556f9abe829aa5905ec307369baec76463506012416f5cec44f398bf30e7639d447d6dffe3c6e7eff2
data/lib/fastly-rails.rb CHANGED
@@ -21,7 +21,7 @@ module FastlyRails
21
21
  end
22
22
 
23
23
  def self.client
24
- raise NoAuthCredentialsProvidedError unless configuration.authenticatable?
24
+ raise NoAPIKeyProvidedError unless configuration.authenticatable?
25
25
 
26
26
  @client ||= Client.new(
27
27
  :api_key => configuration.api_key,
@@ -8,6 +8,7 @@ module FastlyRails
8
8
  end
9
9
 
10
10
  def purge_by_key(key)
11
+ client.require_key!
11
12
  client.post purge_url(key)
12
13
  end
13
14
 
@@ -14,7 +14,7 @@ module FastlyRails
14
14
  end
15
15
 
16
16
  def authenticatable?
17
- !!(api_key || has_credentials?)
17
+ !!api_key
18
18
  end
19
19
 
20
20
  def invalid_service_id?
@@ -1,6 +1,6 @@
1
1
  module FastlyRails
2
2
 
3
- class NoAuthCredentialsProvidedError < ArgumentError; end
3
+ class NoAPIKeyProvidedError < ArgumentError; end
4
4
 
5
5
  class NoServiceIdProvidedError < ArgumentError; end
6
6
  end
@@ -1,3 +1,3 @@
1
1
  module FastlyRails
2
- VERSION = "0.1.7"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -62921,3 +62921,338 @@ Completed 302 Found in 3ms (ActiveRecord: 0.5ms)
62921
62921
   (0.0ms) commit transaction
62922
62922
   (0.0ms) begin transaction
62923
62923
   (0.1ms) rollback transaction
62924
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
62925
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
62926
+  (0.1ms) begin transaction
62927
+  (0.0ms) commit transaction
62928
+  (0.0ms) begin transaction
62929
+  (0.0ms) rollback transaction
62930
+  (0.0ms) begin transaction
62931
+  (0.0ms) commit transaction
62932
+  (0.0ms) begin transaction
62933
+  (0.0ms) rollback transaction
62934
+  (0.0ms) begin transaction
62935
+  (0.0ms) commit transaction
62936
+  (0.0ms) begin transaction
62937
+  (0.0ms) rollback transaction
62938
+  (0.0ms) begin transaction
62939
+ -----------------------------------------------------------------------
62940
+ FastlyHeadersTest: test_/books/:id_show_page_should_have_fastly_headers
62941
+ -----------------------------------------------------------------------
62942
+  (0.0ms) SAVEPOINT active_record_1
62943
+ SQL (1.1ms) INSERT INTO "books" ("created_at", "id", "name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-10-02 08:24:31.462379"], ["id", 1], ["name", "When Cicero Met Abdiel"], ["updated_at", "2014-10-02 08:24:31.462379"]]
62944
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62945
+ Started GET "/books/1" for 127.0.0.1 at 2014-10-02 01:24:31 -0700
62946
+ Processing by BooksController#show as HTML
62947
+ Parameters: {"id"=>"1"}
62948
+ Book Load (0.1ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", 1]]
62949
+ Rendered books/show.html.erb within layouts/application (1.2ms)
62950
+ Completed 200 OK in 17ms (Views: 15.6ms | ActiveRecord: 0.1ms)
62951
+  (0.5ms) rollback transaction
62952
+  (0.0ms) begin transaction
62953
+ --------------------------------------------------------------------
62954
+ FastlyHeadersTest: test_/books_index_page_should_have_fastly_headers
62955
+ --------------------------------------------------------------------
62956
+ Started GET "/books" for 127.0.0.1 at 2014-10-02 01:24:31 -0700
62957
+ Processing by BooksController#index as HTML
62958
+ Book Load (0.1ms) SELECT "books".* FROM "books"
62959
+ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.1ms)
62960
+  (0.1ms) rollback transaction
62961
+  (0.0ms) begin transaction
62962
+ ----------------------------------------------------------------------------------------------
62963
+ FastlyHeadersTest: test_DELETE_/books/:id_should_not_have_fastly_headers/_fastly_header_values
62964
+ ----------------------------------------------------------------------------------------------
62965
+  (0.1ms) SAVEPOINT active_record_1
62966
+ SQL (0.2ms) INSERT INTO "books" ("created_at", "id", "name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-10-02 08:24:31.573782"], ["id", 1], ["name", "Planet of the Death Friday"], ["updated_at", "2014-10-02 08:24:31.573782"]]
62967
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62968
+ Started DELETE "/books/1" for 127.0.0.1 at 2014-10-02 01:24:31 -0700
62969
+ Processing by BooksController#destroy as HTML
62970
+ Parameters: {"id"=>"1"}
62971
+ Book Load (0.0ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", 1]]
62972
+  (0.0ms) SAVEPOINT active_record_1
62973
+ SQL (0.8ms) DELETE FROM "books" WHERE "books"."id" = ? [["id", 1]]
62974
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62975
+ Redirected to http://www.example.com/books
62976
+ Completed 302 Found in 2ms (ActiveRecord: 1.0ms)
62977
+  (0.1ms) SELECT COUNT(*) FROM "books" WHERE "books"."id" = 1
62978
+  (0.4ms) rollback transaction
62979
+  (0.0ms) begin transaction
62980
+ ----------------------------------------------------------------------------------------
62981
+ FastlyHeadersTest: test_POST_/books_should_not_have_fastly_headers/_fastly_header_values
62982
+ ----------------------------------------------------------------------------------------
62983
+  (0.1ms) SELECT COUNT(*) FROM "books"
62984
+ Started POST "/books" for 127.0.0.1 at 2014-10-02 01:24:31 -0700
62985
+ Processing by BooksController#create as HTML
62986
+ Parameters: {"book"=>{"name"=>"some new book"}}
62987
+  (0.0ms) SAVEPOINT active_record_1
62988
+ SQL (0.2ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.586141"], ["name", "some new book"], ["updated_at", "2014-10-02 08:24:31.586141"]]
62989
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62990
+ Redirected to http://www.example.com/books
62991
+ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)
62992
+  (0.0ms) SELECT COUNT(*) FROM "books"
62993
+  (0.3ms) rollback transaction
62994
+  (0.0ms) begin transaction
62995
+ -------------------------------------------------------------------------------------------
62996
+ FastlyHeadersTest: test_PUT_/books/:id_should_not_have_fastly_headers/_fastly_header_values
62997
+ -------------------------------------------------------------------------------------------
62998
+  (0.0ms) SAVEPOINT active_record_1
62999
+ SQL (0.2ms) INSERT INTO "books" ("created_at", "id", "name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-10-02 08:24:31.589552"], ["id", 1], ["name", "some new book"], ["updated_at", "2014-10-02 08:24:31.589552"]]
63000
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63001
+ Started PUT "/books/1" for 127.0.0.1 at 2014-10-02 01:24:31 -0700
63002
+ Processing by BooksController#update as HTML
63003
+ Parameters: {"id"=>"1", "book"=>{"name"=>"changed book"}}
63004
+ Book Load (0.0ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", 1]]
63005
+  (0.0ms) SAVEPOINT active_record_1
63006
+ SQL (0.3ms) UPDATE "books" SET "name" = ?, "updated_at" = ? WHERE "books"."id" = 1 [["name", "changed book"], ["updated_at", "2014-10-02 08:24:31.592648"]]
63007
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63008
+ Redirected to http://www.example.com/books/1
63009
+ Completed 302 Found in 2ms (ActiveRecord: 0.4ms)
63010
+ Book Load (0.0ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", 1]]
63011
+  (0.6ms) rollback transaction
63012
+  (0.1ms) begin transaction
63013
+  (0.0ms) commit transaction
63014
+  (0.0ms) begin transaction
63015
+  (0.1ms) rollback transaction
63016
+  (0.0ms) begin transaction
63017
+ --------------------------------
63018
+ BooksControllerTest: test_create
63019
+ --------------------------------
63020
+  (0.1ms) SAVEPOINT active_record_1
63021
+ SQL (0.3ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.599563"], ["name", "Je Vous Presente, Lee"], ["updated_at", "2014-10-02 08:24:31.599563"]]
63022
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63023
+  (0.0ms) SAVEPOINT active_record_1
63024
+ SQL (0.2ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.600954"], ["name", "Dangerous Clash"], ["updated_at", "2014-10-02 08:24:31.600954"]]
63025
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63026
+  (0.0ms) SAVEPOINT active_record_1
63027
+ SQL (0.0ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.601898"], ["name", "I am Killer Jungle"], ["updated_at", "2014-10-02 08:24:31.601898"]]
63028
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63029
+  (0.0ms) SAVEPOINT active_record_1
63030
+ SQL (0.1ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.602590"], ["name", "The Hills with a Thousand Faces"], ["updated_at", "2014-10-02 08:24:31.602590"]]
63031
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63032
+  (0.0ms) SAVEPOINT active_record_1
63033
+ SQL (0.1ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.603398"], ["name", "Journey of the Killer Hills"], ["updated_at", "2014-10-02 08:24:31.603398"]]
63034
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63035
+  (0.1ms) SELECT COUNT(*) FROM "books"
63036
+ Processing by BooksController#create as HTML
63037
+ Parameters: {"book"=>{"name"=>"newly-created-book"}}
63038
+  (0.0ms) SAVEPOINT active_record_1
63039
+ SQL (0.1ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.607015"], ["name", "newly-created-book"], ["updated_at", "2014-10-02 08:24:31.607015"]]
63040
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63041
+ Redirected to http://test.host/books
63042
+ Completed 302 Found in 1ms (ActiveRecord: 0.1ms)
63043
+  (0.1ms) SELECT COUNT(*) FROM "books"
63044
+  (0.5ms) rollback transaction
63045
+  (0.0ms) begin transaction
63046
+ -------------------------------
63047
+ BooksControllerTest: test_index
63048
+ -------------------------------
63049
+  (0.0ms) SAVEPOINT active_record_1
63050
+ SQL (0.3ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.610062"], ["name", "Rise of the Beast"], ["updated_at", "2014-10-02 08:24:31.610062"]]
63051
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63052
+  (0.0ms) SAVEPOINT active_record_1
63053
+ SQL (0.4ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.611062"], ["name", "The Dangerous Monster from Hell"], ["updated_at", "2014-10-02 08:24:31.611062"]]
63054
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63055
+  (0.0ms) SAVEPOINT active_record_1
63056
+ SQL (0.1ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.612346"], ["name", "I am Forbidden Thief"], ["updated_at", "2014-10-02 08:24:31.612346"]]
63057
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63058
+  (0.0ms) SAVEPOINT active_record_1
63059
+ SQL (0.0ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.613269"], ["name", "The Black Rose of Scotland"], ["updated_at", "2014-10-02 08:24:31.613269"]]
63060
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63061
+  (0.0ms) SAVEPOINT active_record_1
63062
+ SQL (0.0ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.614143"], ["name", "Hard Boiled Mutant"], ["updated_at", "2014-10-02 08:24:31.614143"]]
63063
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63064
+ Processing by BooksController#index as HTML
63065
+ Book Load (0.1ms) SELECT "books".* FROM "books"
63066
+ Completed 200 OK in 2ms (Views: 0.9ms | ActiveRecord: 0.1ms)
63067
+  (0.1ms) SELECT COUNT(*) FROM "books"
63068
+  (0.5ms) rollback transaction
63069
+  (0.1ms) begin transaction
63070
+ ----------------------------------------------------
63071
+ BooksControllerTest: test_index_with_multiple_params
63072
+ ----------------------------------------------------
63073
+  (0.0ms) SAVEPOINT active_record_1
63074
+ SQL (0.2ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.620525"], ["name", "The Wolf Who Fell to Earth"], ["updated_at", "2014-10-02 08:24:31.620525"]]
63075
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63076
+  (0.0ms) SAVEPOINT active_record_1
63077
+ SQL (0.3ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.621655"], ["name", "The Ninjas"], ["updated_at", "2014-10-02 08:24:31.621655"]]
63078
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63079
+  (0.0ms) SAVEPOINT active_record_1
63080
+ SQL (0.1ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.622591"], ["name", "Dangerous Rain"], ["updated_at", "2014-10-02 08:24:31.622591"]]
63081
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63082
+  (0.0ms) SAVEPOINT active_record_1
63083
+ SQL (0.1ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.623287"], ["name", "Forbidden Tentacle"], ["updated_at", "2014-10-02 08:24:31.623287"]]
63084
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63085
+  (0.0ms) SAVEPOINT active_record_1
63086
+ SQL (0.0ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.624000"], ["name", "Journey of the Rain"], ["updated_at", "2014-10-02 08:24:31.624000"]]
63087
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63088
+ Processing by BooksController#index as HTML
63089
+ Book Load (0.1ms) SELECT "books".* FROM "books"
63090
+ Completed 200 OK in 2ms (Views: 0.8ms | ActiveRecord: 0.1ms)
63091
+  (0.4ms) rollback transaction
63092
+  (0.1ms) begin transaction
63093
+ ------------------------------
63094
+ BooksControllerTest: test_show
63095
+ ------------------------------
63096
+  (0.0ms) SAVEPOINT active_record_1
63097
+ SQL (0.2ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.629223"], ["name", "The Fake Hills with a Thousand Faces"], ["updated_at", "2014-10-02 08:24:31.629223"]]
63098
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63099
+  (0.0ms) SAVEPOINT active_record_1
63100
+ SQL (0.2ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.630272"], ["name", "Legend of Beast"], ["updated_at", "2014-10-02 08:24:31.630272"]]
63101
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63102
+  (0.0ms) SAVEPOINT active_record_1
63103
+ SQL (0.0ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.631096"], ["name", "176 A.D."], ["updated_at", "2014-10-02 08:24:31.631096"]]
63104
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63105
+  (0.0ms) SAVEPOINT active_record_1
63106
+ SQL (0.0ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.631733"], ["name", "American Thief 2: Son of American Thief"], ["updated_at", "2014-10-02 08:24:31.631733"]]
63107
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63108
+  (0.0ms) SAVEPOINT active_record_1
63109
+ SQL (0.0ms) INSERT INTO "books" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-10-02 08:24:31.632362"], ["name", "The Men"], ["updated_at", "2014-10-02 08:24:31.632362"]]
63110
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63111
+ Processing by BooksController#show as HTML
63112
+ Parameters: {"id"=>"1"}
63113
+ Book Load (0.0ms) SELECT "books".* FROM "books" WHERE "books"."id" = ? LIMIT 1 [["id", 1]]
63114
+ Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)
63115
+  (0.5ms) rollback transaction
63116
+  (0.1ms) begin transaction
63117
+  (0.0ms) commit transaction
63118
+  (0.0ms) begin transaction
63119
+  (0.0ms) rollback transaction
63120
+  (0.0ms) begin transaction
63121
+  (0.0ms) commit transaction
63122
+  (0.0ms) begin transaction
63123
+  (0.0ms) rollback transaction
63124
+  (0.0ms) begin transaction
63125
+  (0.0ms) commit transaction
63126
+  (0.0ms) begin transaction
63127
+  (0.0ms) rollback transaction
63128
+  (0.0ms) begin transaction
63129
+ -------------------------------------------------------------------------------------------------
63130
+ FastlyRails::CacheControlHeadersTest: test_sets_cache_control_headers_on_actioncontroller_request
63131
+ -------------------------------------------------------------------------------------------------
63132
+  (0.0ms) rollback transaction
63133
+  (0.0ms) begin transaction
63134
+  (0.0ms) commit transaction
63135
+  (0.0ms) begin transaction
63136
+  (0.1ms) rollback transaction
63137
+  (0.0ms) begin transaction
63138
+  (0.0ms) commit transaction
63139
+  (0.0ms) begin transaction
63140
+  (0.0ms) rollback transaction
63141
+  (0.0ms) begin transaction
63142
+  (0.0ms) commit transaction
63143
+  (0.0ms) begin transaction
63144
+  (0.1ms) rollback transaction
63145
+  (0.0ms) begin transaction
63146
+  (0.0ms) commit transaction
63147
+  (0.0ms) begin transaction
63148
+  (0.1ms) rollback transaction
63149
+  (0.0ms) begin transaction
63150
+  (0.0ms) commit transaction
63151
+  (0.0ms) begin transaction
63152
+  (0.0ms) rollback transaction
63153
+  (0.0ms) begin transaction
63154
+  (0.0ms) commit transaction
63155
+  (0.0ms) begin transaction
63156
+  (0.0ms) rollback transaction
63157
+  (0.0ms) begin transaction
63158
+  (0.0ms) commit transaction
63159
+  (0.0ms) begin transaction
63160
+  (0.0ms) rollback transaction
63161
+  (0.0ms) begin transaction
63162
+  (0.0ms) commit transaction
63163
+  (0.0ms) begin transaction
63164
+  (0.0ms) rollback transaction
63165
+  (0.0ms) begin transaction
63166
+  (0.0ms) commit transaction
63167
+  (0.0ms) begin transaction
63168
+  (0.0ms) rollback transaction
63169
+  (0.0ms) begin transaction
63170
+  (0.0ms) commit transaction
63171
+  (0.0ms) begin transaction
63172
+  (0.0ms) rollback transaction
63173
+  (0.0ms) begin transaction
63174
+  (0.0ms) commit transaction
63175
+  (0.0ms) begin transaction
63176
+  (0.0ms) rollback transaction
63177
+  (0.0ms) begin transaction
63178
+  (0.0ms) commit transaction
63179
+  (0.0ms) begin transaction
63180
+  (0.0ms) rollback transaction
63181
+  (0.0ms) begin transaction
63182
+  (0.0ms) commit transaction
63183
+  (0.0ms) begin transaction
63184
+  (0.0ms) rollback transaction
63185
+  (0.0ms) begin transaction
63186
+  (0.0ms) commit transaction
63187
+  (0.0ms) begin transaction
63188
+  (0.0ms) rollback transaction
63189
+  (0.0ms) begin transaction
63190
+  (0.0ms) commit transaction
63191
+  (0.0ms) begin transaction
63192
+  (0.0ms) SAVEPOINT active_record_1
63193
+ SQL (0.3ms) INSERT INTO "books" ("created_at", "id", "name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-10-02 08:24:31.656276"], ["id", 1], ["name", "Dr. Women"], ["updated_at", "2014-10-02 08:24:31.656276"]]
63194
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63195
+  (0.4ms) rollback transaction
63196
+  (0.0ms) begin transaction
63197
+  (0.0ms) commit transaction
63198
+  (0.0ms) begin transaction
63199
+  (0.0ms) SAVEPOINT active_record_1
63200
+ SQL (0.2ms) INSERT INTO "books" ("created_at", "id", "name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-10-02 08:24:31.658759"], ["id", 1], ["name", "Invasion of the City"], ["updated_at", "2014-10-02 08:24:31.658759"]]
63201
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63202
+  (0.4ms) rollback transaction
63203
+  (0.0ms) begin transaction
63204
+  (0.0ms) commit transaction
63205
+  (0.0ms) begin transaction
63206
+  (0.0ms) SAVEPOINT active_record_1
63207
+ SQL (0.3ms) INSERT INTO "books" ("created_at", "id", "name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-10-02 08:24:31.661044"], ["id", 1], ["name", "Ultra Cousins"], ["updated_at", "2014-10-02 08:24:31.661044"]]
63208
+  (0.1ms) RELEASE SAVEPOINT active_record_1
63209
+  (0.3ms) rollback transaction
63210
+  (0.0ms) begin transaction
63211
+  (0.0ms) commit transaction
63212
+  (0.0ms) begin transaction
63213
+  (0.1ms) SAVEPOINT active_record_1
63214
+ SQL (0.3ms) INSERT INTO "books" ("created_at", "id", "name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-10-02 08:24:31.664051"], ["id", 1], ["name", "The Blue Diaries from the Black Lagoon"], ["updated_at", "2014-10-02 08:24:31.664051"]]
63215
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63216
+  (0.4ms) rollback transaction
63217
+  (0.0ms) begin transaction
63218
+  (0.0ms) commit transaction
63219
+  (0.0ms) begin transaction
63220
+  (0.0ms) rollback transaction
63221
+  (0.0ms) begin transaction
63222
+  (0.1ms) commit transaction
63223
+  (0.0ms) begin transaction
63224
+  (0.0ms) SAVEPOINT active_record_1
63225
+ SQL (0.3ms) INSERT INTO "books" ("created_at", "id", "name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-10-02 08:24:31.668010"], ["id", 1], ["name", "The Brain from Across the Ocean"], ["updated_at", "2014-10-02 08:24:31.668010"]]
63226
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63227
+  (0.4ms) rollback transaction
63228
+  (0.0ms) begin transaction
63229
+  (0.0ms) commit transaction
63230
+  (0.0ms) begin transaction
63231
+  (0.0ms) SAVEPOINT active_record_1
63232
+ SQL (0.2ms) INSERT INTO "books" ("created_at", "id", "name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-10-02 08:24:31.670915"], ["id", 1], ["name", "The Blue Cousins from Outer Space"], ["updated_at", "2014-10-02 08:24:31.670915"]]
63233
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63234
+  (0.4ms) rollback transaction
63235
+  (0.0ms) begin transaction
63236
+  (0.0ms) commit transaction
63237
+  (0.0ms) begin transaction
63238
+  (0.0ms) rollback transaction
63239
+  (0.0ms) begin transaction
63240
+  (0.0ms) commit transaction
63241
+  (0.0ms) begin transaction
63242
+  (0.0ms) rollback transaction
63243
+  (0.0ms) begin transaction
63244
+  (0.0ms) commit transaction
63245
+  (0.0ms) begin transaction
63246
+  (0.0ms) rollback transaction
63247
+  (0.0ms) begin transaction
63248
+  (0.0ms) commit transaction
63249
+  (0.0ms) begin transaction
63250
+  (0.0ms) rollback transaction
63251
+  (0.0ms) begin transaction
63252
+  (0.0ms) commit transaction
63253
+  (0.0ms) begin transaction
63254
+  (0.0ms) rollback transaction
63255
+  (0.0ms) begin transaction
63256
+  (0.0ms) commit transaction
63257
+  (0.0ms) begin transaction
63258
+  (0.0ms) rollback transaction
@@ -42,7 +42,7 @@ describe FastlyRails::Configuration do
42
42
  assert_respond_to configuration, :authenticatable?
43
43
  end
44
44
 
45
- it 'should return false if api_key, user, and password are nil' do
45
+ it 'should return false if api_key is nil' do
46
46
  assert_equal false, configuration.authenticatable?
47
47
  end
48
48
 
@@ -53,16 +53,15 @@ describe FastlyRails::Configuration do
53
53
  end
54
54
 
55
55
  it 'should return true if only api_key is not nil' do
56
- configuration.api_key = 'key'
57
-
56
+ configuration.api_key = 'test'
58
57
  assert_equal true, configuration.authenticatable?
59
58
  end
60
59
 
61
- it 'should return true if if user and password are not nil' do
60
+ it 'should return false if only user and password are not nil' do
62
61
  configuration.user = 'user'
63
62
  configuration.password = 'password'
64
63
 
65
- assert_equal true, configuration.authenticatable?
64
+ assert_equal false, configuration.authenticatable?
66
65
  end
67
66
  end
68
67
 
@@ -1,7 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
3
  describe FastlyRails do
4
-
5
4
  let(:api_key) { 'test' }
6
5
  let(:user) { nil }
7
6
  let(:password) { nil }
@@ -15,16 +14,14 @@ describe FastlyRails do
15
14
  end
16
15
 
17
16
  describe 'credentials not provided' do
18
-
19
17
  before do
20
18
  FastlyRails.instance_variable_set('@configuration', FastlyRails::Configuration.new)
21
19
  end
22
20
 
23
21
  it 'should raise an error if configuration is not authenticatable' do
24
-
25
22
  assert_equal false, configuration.authenticatable?
26
23
  assert_equal true, configuration.invalid_service_id?
27
- assert_raises FastlyRails::NoAuthCredentialsProvidedError do
24
+ assert_raises FastlyRails::NoAPIKeyProvidedError do
28
25
  client
29
26
  end
30
27
  assert_raises FastlyRails::NoServiceIdProvidedError do
@@ -34,9 +31,7 @@ describe FastlyRails do
34
31
  end
35
32
 
36
33
  describe 'credentials provided' do
37
-
38
34
  before do
39
-
40
35
  FastlyRails.configure do |c|
41
36
  c.api_key = api_key
42
37
  c.user = user
@@ -44,23 +39,18 @@ describe FastlyRails do
44
39
  c.max_age = max_age
45
40
  c.service_id = service_id
46
41
  end
47
-
48
42
  end
49
43
 
50
-
51
44
  it 'should have configuration options set up' do
52
-
53
45
  assert_equal api_key, configuration.api_key
54
46
  assert_equal user, configuration.user
55
47
  assert_equal password, configuration.password
56
48
  assert_equal max_age, configuration.max_age
57
49
  assert_equal service_id, configuration.service_id
58
-
59
50
  end
60
51
 
61
52
  it 'should return a valid client' do
62
53
  assert_instance_of FastlyRails::Client, client
63
54
  end
64
-
65
55
  end
66
56
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastly-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael May
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-10-01 00:00:00.000000000 Z
14
+ date: 2014-10-02 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -33,14 +33,14 @@ dependencies:
33
33
  requirements:
34
34
  - - ~>
35
35
  - !ruby/object:Gem::Version
36
- version: 1.1.2
36
+ version: 1.1.4
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - ~>
42
42
  - !ruby/object:Gem::Version
43
- version: 1.1.2
43
+ version: 1.1.4
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: sqlite3
46
46
  requirement: !ruby/object:Gem::Requirement