stocktwits 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/.document +5 -0
  2. data/.gitignore +21 -0
  3. data/LICENSE +20 -0
  4. data/README +0 -0
  5. data/README.rdoc +17 -0
  6. data/Rakefile +63 -0
  7. data/VERSION +1 -0
  8. data/app/controllers/sessions_controller.rb +68 -0
  9. data/app/models/stocktwits/basic_user.rb +64 -0
  10. data/app/models/stocktwits/generic_user.rb +123 -0
  11. data/app/models/stocktwits/oauth_user.rb +46 -0
  12. data/app/models/stocktwits/plain_user.rb +53 -0
  13. data/app/views/sessions/_login.html.erb +18 -0
  14. data/app/views/sessions/new.html.erb +5 -0
  15. data/config/routes.rb +6 -0
  16. data/generators/stocktwits/USAGE +12 -0
  17. data/generators/stocktwits/stocktwits_generator.rb +42 -0
  18. data/generators/stocktwits/templates/migration.rb +20 -0
  19. data/generators/stocktwits/templates/stocktwits.yml +66 -0
  20. data/generators/stocktwits/templates/user.rb +5 -0
  21. data/lib/stocktwits.rb +103 -0
  22. data/lib/stocktwits/controller_extensions.rb +72 -0
  23. data/lib/stocktwits/cryptify.rb +30 -0
  24. data/lib/stocktwits/dispatcher/basic.rb +46 -0
  25. data/lib/stocktwits/dispatcher/oauth.rb +26 -0
  26. data/lib/stocktwits/dispatcher/plain.rb +44 -0
  27. data/lib/stocktwits/dispatcher/shared.rb +42 -0
  28. data/rails/init.rb +6 -0
  29. data/spec/application.rb +1 -0
  30. data/spec/controllers/controller_extensions_spec.rb +162 -0
  31. data/spec/controllers/sessions_controller_spec.rb +221 -0
  32. data/spec/debug.log +397 -0
  33. data/spec/fixtures/config/twitter_auth.yml +17 -0
  34. data/spec/fixtures/factories.rb +28 -0
  35. data/spec/fixtures/fakeweb.rb +18 -0
  36. data/spec/fixtures/stocktwits.rb +5 -0
  37. data/spec/models/stocktwits/basic_user_spec.rb +138 -0
  38. data/spec/models/stocktwits/generic_user_spec.rb +146 -0
  39. data/spec/models/stocktwits/oauth_user_spec.rb +100 -0
  40. data/spec/schema.rb +25 -0
  41. data/spec/spec.opts +1 -0
  42. data/spec/spec_helper.rb +107 -0
  43. data/spec/stocktwits/cryptify_spec.rb +51 -0
  44. data/spec/stocktwits/dispatcher/basic_spec.rb +83 -0
  45. data/spec/stocktwits/dispatcher/oauth_spec.rb +72 -0
  46. data/spec/stocktwits/dispatcher/shared_spec.rb +26 -0
  47. data/spec/stocktwits_spec.rb +173 -0
  48. data/stocktwits.gemspec +116 -0
  49. metadata +158 -0
data/spec/debug.log ADDED
@@ -0,0 +1,397 @@
1
+ # Logfile created on Fri Mar 12 19:19:43 -0500 2010 by logger.rb/22285
2
+ SQL (0.2ms) select sqlite_version(*)
3
+ SQL (0.1ms)  SELECT name
4
+ FROM sqlite_master
5
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
6
+ 
7
+ SQL (16.7ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
8
+ SQL (0.1ms)  SELECT name
9
+ FROM sqlite_master
10
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
11
+ 
12
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
13
+ SQL (3.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
14
+ SQL (0.1ms)  SELECT name
15
+ FROM sqlite_master
16
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
17
+ 
18
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
19
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
20
+ SQL (0.2ms) select sqlite_version(*)
21
+ SQL (0.1ms)  SELECT name
22
+ FROM sqlite_master
23
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
24
+ 
25
+ SQL (0.3ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
26
+ SQL (0.1ms)  SELECT name
27
+ FROM sqlite_master
28
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
29
+ 
30
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
31
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
32
+ SQL (0.1ms)  SELECT name
33
+ FROM sqlite_master
34
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
35
+ 
36
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
37
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
38
+ SQL (0.2ms) select sqlite_version(*)
39
+ SQL (0.1ms)  SELECT name
40
+ FROM sqlite_master
41
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
42
+ 
43
+ SQL (0.3ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
44
+ SQL (0.1ms)  SELECT name
45
+ FROM sqlite_master
46
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
47
+ 
48
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
49
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
50
+ SQL (0.1ms)  SELECT name
51
+ FROM sqlite_master
52
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
53
+ 
54
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
55
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
56
+ SQL (0.2ms) select sqlite_version(*)
57
+ SQL (0.1ms)  SELECT name
58
+ FROM sqlite_master
59
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
60
+ 
61
+ SQL (0.3ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
62
+ SQL (0.1ms)  SELECT name
63
+ FROM sqlite_master
64
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
65
+ 
66
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
67
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
68
+ SQL (0.1ms)  SELECT name
69
+ FROM sqlite_master
70
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
71
+ 
72
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
73
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
74
+ SQL (0.2ms) select sqlite_version(*)
75
+ SQL (0.1ms)  SELECT name
76
+ FROM sqlite_master
77
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
78
+ 
79
+ SQL (0.2ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
80
+ SQL (0.1ms)  SELECT name
81
+ FROM sqlite_master
82
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
83
+ 
84
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
85
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
86
+ SQL (0.1ms)  SELECT name
87
+ FROM sqlite_master
88
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
89
+ 
90
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
91
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
92
+ SQL (0.2ms) select sqlite_version(*)
93
+ SQL (0.1ms)  SELECT name
94
+ FROM sqlite_master
95
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
96
+ 
97
+ SQL (0.3ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
98
+ SQL (0.1ms)  SELECT name
99
+ FROM sqlite_master
100
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
101
+ 
102
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
103
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
104
+ SQL (0.1ms)  SELECT name
105
+ FROM sqlite_master
106
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
107
+ 
108
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
109
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
110
+ SQL (0.2ms) select sqlite_version(*)
111
+ SQL (0.1ms)  SELECT name
112
+ FROM sqlite_master
113
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
114
+ 
115
+ SQL (0.3ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
116
+ SQL (0.1ms)  SELECT name
117
+ FROM sqlite_master
118
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
119
+ 
120
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
121
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
122
+ SQL (0.1ms)  SELECT name
123
+ FROM sqlite_master
124
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
125
+ 
126
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
127
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
128
+ SQL (0.1ms) select sqlite_version(*)
129
+ SQL (0.1ms)  SELECT name
130
+ FROM sqlite_master
131
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
132
+ 
133
+ SQL (0.2ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
134
+ SQL (0.1ms)  SELECT name
135
+ FROM sqlite_master
136
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
137
+ 
138
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
139
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
140
+ SQL (0.1ms)  SELECT name
141
+ FROM sqlite_master
142
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
143
+ 
144
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
145
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
146
+ SQL (0.2ms) select sqlite_version(*)
147
+ SQL (0.1ms)  SELECT name
148
+ FROM sqlite_master
149
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
150
+ 
151
+ SQL (0.3ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
152
+ SQL (0.1ms)  SELECT name
153
+ FROM sqlite_master
154
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
155
+ 
156
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
157
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
158
+ SQL (0.1ms)  SELECT name
159
+ FROM sqlite_master
160
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
161
+ 
162
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
163
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
164
+ SQL (0.1ms) select sqlite_version(*)
165
+ SQL (0.1ms)  SELECT name
166
+ FROM sqlite_master
167
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
168
+ 
169
+ SQL (0.2ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
170
+ SQL (0.1ms)  SELECT name
171
+ FROM sqlite_master
172
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
173
+ 
174
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
175
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
176
+ SQL (0.1ms)  SELECT name
177
+ FROM sqlite_master
178
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
179
+ 
180
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
181
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
182
+ SQL (0.2ms) select sqlite_version(*)
183
+ SQL (0.1ms)  SELECT name
184
+ FROM sqlite_master
185
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
186
+ 
187
+ SQL (0.3ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
188
+ SQL (0.1ms)  SELECT name
189
+ FROM sqlite_master
190
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
191
+ 
192
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
193
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
194
+ SQL (0.1ms)  SELECT name
195
+ FROM sqlite_master
196
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
197
+ 
198
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
199
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
200
+ SQL (0.2ms) select sqlite_version(*)
201
+ SQL (0.1ms)  SELECT name
202
+ FROM sqlite_master
203
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
204
+ 
205
+ SQL (0.2ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
206
+ SQL (0.1ms)  SELECT name
207
+ FROM sqlite_master
208
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
209
+ 
210
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
211
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
212
+ SQL (0.1ms)  SELECT name
213
+ FROM sqlite_master
214
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
215
+ 
216
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
217
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
218
+ SQL (0.2ms) select sqlite_version(*)
219
+ SQL (0.1ms)  SELECT name
220
+ FROM sqlite_master
221
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
222
+ 
223
+ SQL (0.3ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
224
+ SQL (0.1ms)  SELECT name
225
+ FROM sqlite_master
226
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
227
+ 
228
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
229
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
230
+ SQL (0.1ms)  SELECT name
231
+ FROM sqlite_master
232
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
233
+ 
234
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
235
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
236
+ SQL (0.1ms) select sqlite_version(*)
237
+ SQL (0.1ms)  SELECT name
238
+ FROM sqlite_master
239
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
240
+ 
241
+ SQL (0.2ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
242
+ SQL (0.1ms)  SELECT name
243
+ FROM sqlite_master
244
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
245
+ 
246
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
247
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
248
+ SQL (0.1ms)  SELECT name
249
+ FROM sqlite_master
250
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
251
+ 
252
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
253
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
254
+ SQL (0.2ms) select sqlite_version(*)
255
+ SQL (0.1ms)  SELECT name
256
+ FROM sqlite_master
257
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
258
+ 
259
+ SQL (0.3ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
260
+ SQL (0.1ms)  SELECT name
261
+ FROM sqlite_master
262
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
263
+ 
264
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
265
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
266
+ SQL (0.1ms)  SELECT name
267
+ FROM sqlite_master
268
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
269
+ 
270
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
271
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
272
+ SQL (0.1ms) select sqlite_version(*)
273
+ SQL (0.1ms)  SELECT name
274
+ FROM sqlite_master
275
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
276
+ 
277
+ SQL (0.2ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
278
+ SQL (0.1ms)  SELECT name
279
+ FROM sqlite_master
280
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
281
+ 
282
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
283
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
284
+ SQL (0.1ms)  SELECT name
285
+ FROM sqlite_master
286
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
287
+ 
288
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
289
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
290
+ SQL (0.2ms) select sqlite_version(*)
291
+ SQL (0.1ms)  SELECT name
292
+ FROM sqlite_master
293
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
294
+ 
295
+ SQL (0.3ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
296
+ SQL (0.1ms)  SELECT name
297
+ FROM sqlite_master
298
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
299
+ 
300
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
301
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
302
+ SQL (0.1ms)  SELECT name
303
+ FROM sqlite_master
304
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
305
+ 
306
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
307
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
308
+ SQL (0.1ms) select sqlite_version(*)
309
+ SQL (0.1ms)  SELECT name
310
+ FROM sqlite_master
311
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
312
+ 
313
+ SQL (0.2ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
314
+ SQL (0.1ms)  SELECT name
315
+ FROM sqlite_master
316
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
317
+ 
318
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
319
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
320
+ SQL (0.1ms)  SELECT name
321
+ FROM sqlite_master
322
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
323
+ 
324
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
325
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
326
+ SQL (0.2ms) select sqlite_version(*)
327
+ SQL (0.1ms)  SELECT name
328
+ FROM sqlite_master
329
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
330
+ 
331
+ SQL (0.2ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
332
+ SQL (0.1ms)  SELECT name
333
+ FROM sqlite_master
334
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
335
+ 
336
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
337
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
338
+ SQL (0.1ms)  SELECT name
339
+ FROM sqlite_master
340
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
341
+ 
342
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
343
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
344
+ SQL (0.1ms) select sqlite_version(*)
345
+ SQL (0.1ms)  SELECT name
346
+ FROM sqlite_master
347
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
348
+ 
349
+ SQL (0.2ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
350
+ SQL (0.1ms)  SELECT name
351
+ FROM sqlite_master
352
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
353
+ 
354
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
355
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
356
+ SQL (0.2ms)  SELECT name
357
+ FROM sqlite_master
358
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
359
+ 
360
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
361
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
362
+ SQL (0.2ms) select sqlite_version(*)
363
+ SQL (0.1ms)  SELECT name
364
+ FROM sqlite_master
365
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
366
+ 
367
+ SQL (0.3ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
368
+ SQL (0.1ms)  SELECT name
369
+ FROM sqlite_master
370
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
371
+ 
372
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
373
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
374
+ SQL (0.1ms)  SELECT name
375
+ FROM sqlite_master
376
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
377
+ 
378
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
379
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
380
+ SQL (0.1ms) select sqlite_version(*)
381
+ SQL (0.1ms)  SELECT name
382
+ FROM sqlite_master
383
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
384
+ 
385
+ SQL (0.2ms) CREATE TABLE "stocktwits_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "twitter_id" varchar(255), "login" varchar(255), "access_token" varchar(255), "access_secret" varchar(255), "crypted_password" blob, "salt" varchar(255), "remember_token" varchar(255), "remember_token_expires_at" datetime, "created_at" datetime, "updated_at" datetime) 
386
+ SQL (0.1ms)  SELECT name
387
+ FROM sqlite_master
388
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
389
+ 
390
+ SQL (0.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
391
+ SQL (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
392
+ SQL (0.1ms)  SELECT name
393
+ FROM sqlite_master
394
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
395
+ 
396
+ SQL (0.1ms) SELECT version FROM "schema_migrations"
397
+ SQL (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
@@ -0,0 +1,17 @@
1
+ development:
2
+ strategy: oauth
3
+ base_url: "http://api.stocktwits.com"
4
+ oauth_consumer_key: devkey
5
+ oauth_consumer_secret: devsecret
6
+ oauth_callback: "http://localhost:3000"
7
+ test:
8
+ strategy: oauth
9
+ base_url: "http://api.stocktwits.com"
10
+ oauth_consumer_key: testkey
11
+ oauth_consumer_secret: testsecret
12
+ production:
13
+ strategy: oauth
14
+ base_url: "http://api.stocktwits.com"
15
+ oauth_consumer_key: prodkey
16
+ oauth_consumer_secret: prodsecret
17
+
@@ -0,0 +1,28 @@
1
+ require 'factory_girl'
2
+
3
+ Factory.define(:stocktwits_oauth_user, :class => User) do |u|
4
+ u.stocktwits_id { User.count + 1 }
5
+ u.login 'stocktwitsman'
6
+ u.access_token 'fakeaccesstoken'
7
+ u.access_secret 'fakeaccesstokensecret'
8
+
9
+ u.name 'Stocktwits Man'
10
+ u.description 'Saving the world for all Stocktwits kind.'
11
+ end
12
+
13
+ Factory.define(:stocktwits_basic_user, :class => User) do |u|
14
+ u.stocktwits_id { User.count + 1 }
15
+ u.login 'stocktwitsman'
16
+ u.password 'test'
17
+
18
+ u.name 'Stocktwits Man'
19
+ u.description 'Saving the world for all Stocktwits kind.'
20
+ end
21
+
22
+ Factory.define(:stocktwits_plain_user, :class => User) do |u|
23
+ u.stocktwits_id { User.count + 1 }
24
+ u.login 'stocktwitsman'
25
+
26
+ u.name 'Stocktwits Man'
27
+ u.description 'Saving the world for all Stocktwits kind.'
28
+ end
@@ -0,0 +1,18 @@
1
+ # This is where we fake out all of the URLs that we
2
+ # will be calling as a part of this spec suite.
3
+ # You must have the 'fakeweb' gem in order to run
4
+ # the tests for TwitterAuth.
5
+ #
6
+ # gem install 'mbleigh-fakeweb'
7
+
8
+ require 'fake_web'
9
+
10
+ FakeWeb.allow_net_connect = false
11
+
12
+ FakeWeb.register_uri(:post, 'https://twitter.com:443/oauth/request_token', :body => 'oauth_token=faketoken&oauth_token_secret=faketokensecret')
13
+
14
+ FakeWeb.register_uri(:post, 'https://twitter.com:443/oauth/access_token', :body => 'oauth_token=fakeaccesstoken&oauth_token_secret=fakeaccesstokensecret')
15
+
16
+ FakeWeb.register_uri(:get, 'https://twitter.com:443/account/verify_credentials.json', :body => "{\"profile_image_url\":\"http:\\/\\/static.twitter.com\\/images\\/default_profile_normal.png\",\"description\":\"Saving the world for all Twitter kind.\",\"utc_offset\":null,\"favourites_count\":0,\"profile_sidebar_fill_color\":\"e0ff92\",\"screen_name\":\"twitterman\",\"statuses_count\":0,\"profile_background_tile\":false,\"profile_sidebar_border_color\":\"87bc44\",\"friends_count\":2,\"url\":null,\"name\":\"Twitter Man\",\"time_zone\":null,\"protected\":false,\"profile_background_image_url\":\"http:\\/\\/static.twitter.com\\/images\\/themes\\/theme1\\/bg.gif\",\"profile_background_color\":\"9ae4e8\",\"created_at\":\"Fri Feb 06 18:10:32 +0000 2009\",\"profile_text_color\":\"000000\",\"followers_count\":2,\"location\":null,\"id\":123,\"profile_link_color\":\"0000ff\"}")
17
+
18
+ #FakeWeb.register_uri(:get, 'https://twitter.com:443/)