muck-engine 0.2.22 → 0.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/muck_engine.rb +6 -1
- data/lib/test/muck_factories.rb +19 -1
- data/lib/test/muck_test_methods.rb +0 -4
- data/lib/test/shoulda_macros/controller.rb +39 -4
- data/lib/test/shoulda_macros/scopes.rb +1 -1
- data/muck-engine.gemspec +7 -2
- data/public/images/service_icons/16/fireeagle.png +0 -0
- data/public/images/service_icons/24/fireeagle.png +0 -0
- data/public/images/service_icons/48/fireeagle.png +0 -0
- data/public/images/service_icons/60/fireeagle.png +0 -0
- data/public/images/service_icons/source/fireeagle.psd +0 -0
- data/test/rails_root/config/database.yml +12 -11
- metadata +7 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.23
|
data/lib/muck_engine.rb
CHANGED
@@ -9,4 +9,9 @@ I18n.load_path += Dir[ File.join(File.dirname(__FILE__), '..', 'rails_i18n', '*.
|
|
9
9
|
Mime::Type.register "application/rdf+xml", :rdf
|
10
10
|
Mime::Type.register "text/xml", :opml
|
11
11
|
Mime::Type.register "text/javascript", :pjs
|
12
|
-
Mime::Type.register_alias "text/html", :iphone
|
12
|
+
Mime::Type.register_alias "text/html", :iphone
|
13
|
+
|
14
|
+
# Use to determine whether or not ssl should be used
|
15
|
+
def muck_routes_protocol
|
16
|
+
@@routes_protocol ||= GlobalConfig.enable_ssl ? (ENV["RAILS_ENV"] =~ /(development|test)/ ? "http" : "https") : 'http'
|
17
|
+
end
|
data/lib/test/muck_factories.rb
CHANGED
@@ -209,9 +209,27 @@ end
|
|
209
209
|
|
210
210
|
Factory.define :content_permission do |f|
|
211
211
|
f.content { |a| a.association(:content) }
|
212
|
-
f.user {|a| a.association(:user)}
|
212
|
+
f.user { |a| a.association(:user) }
|
213
213
|
end
|
214
214
|
|
215
215
|
Factory.define :invitee do |f|
|
216
216
|
f.email { Factory.next(:email) }
|
217
|
+
end
|
218
|
+
|
219
|
+
Factory.define :group do |f|
|
220
|
+
f.creator {|a| a.association(:user)}
|
221
|
+
f.name { Factory.next(:name) }
|
222
|
+
f.member_count 0
|
223
|
+
end
|
224
|
+
|
225
|
+
Factory.define :membership_requests do |f|
|
226
|
+
f.group {|a| a.association(:group)}
|
227
|
+
f.user {|a| a.association(:user)}
|
228
|
+
end
|
229
|
+
|
230
|
+
Factory.define :memberships do |f|
|
231
|
+
f.group {|a| a.association(:group)}
|
232
|
+
f.user {|a| a.association(:user)}
|
233
|
+
f.banned false
|
234
|
+
f.role "member"
|
217
235
|
end
|
@@ -1,8 +1,18 @@
|
|
1
1
|
module MuckControllerMacros
|
2
2
|
|
3
|
+
# Ensure a login is required for the given actions
|
4
|
+
# Parameters:
|
5
|
+
# Pass the following as arguements
|
6
|
+
# :login_url => '/login' -- url the user should be redirected to if they aren't logged in. Defaults to '/login'
|
7
|
+
# :get => 'index'
|
8
|
+
# :post => 'create'
|
9
|
+
#
|
10
|
+
# Example:
|
11
|
+
# should_require_login :login_url => '/signup', :get => 'index'
|
3
12
|
def should_require_login(*args)
|
4
13
|
args = Hash[*args]
|
5
14
|
login_url = args.delete :login_url
|
15
|
+
login_url ||= '/login'
|
6
16
|
args.each do |action, verb|
|
7
17
|
should "Require login for '#{action}' action" do
|
8
18
|
if [:put, :delete].include?(verb) # put and delete require an id even if it is a bogus one
|
@@ -15,12 +25,37 @@ module MuckControllerMacros
|
|
15
25
|
end
|
16
26
|
end
|
17
27
|
|
18
|
-
|
19
|
-
|
28
|
+
# Ensure the user is in a given role for the given actions. The test user will need to be logged in.
|
29
|
+
# Parameters:
|
30
|
+
# role: The role required for the user
|
31
|
+
#
|
32
|
+
# Pass the following as arguements
|
33
|
+
# :login_url => '/login' -- url the user should be redirected to if they aren't logged in. Defaults to '/login'
|
34
|
+
# :get => 'index'
|
35
|
+
# :post => 'create'
|
36
|
+
#
|
37
|
+
# Example:
|
38
|
+
# context "logged in not admin" do
|
39
|
+
# setup do
|
40
|
+
# @user = Factory(:user)
|
41
|
+
# activate_authlogic
|
42
|
+
# login_as @user
|
43
|
+
# end
|
44
|
+
# should_require_role('admin', :redirect_url => '/login', :index => :get)
|
45
|
+
# end
|
46
|
+
def should_require_role(role, *args)
|
47
|
+
args = Hash[*args]
|
48
|
+
redirect_url = args.delete :redirect_url
|
49
|
+
redirect_url ||= '/login'
|
50
|
+
args.each do |action, verb|
|
20
51
|
should "require role for '#{action}' action" do
|
21
|
-
|
52
|
+
if [:put, :delete].include?(verb) # put and delete require an id even if it is a bogus one
|
53
|
+
send(verb, action, :id => 1)
|
54
|
+
else
|
55
|
+
send(verb, action)
|
56
|
+
end
|
22
57
|
ensure_flash(/permission/i)
|
23
|
-
|
58
|
+
assert_redirected_to(redirect_url)
|
24
59
|
end
|
25
60
|
end
|
26
61
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Named scopes tested by these macros:
|
2
2
|
#
|
3
|
-
# named_scope :by_title, :order => "
|
3
|
+
# named_scope :by_title, :order => "title ASC"
|
4
4
|
# named_scope :by_name, :order => "name ASC"
|
5
5
|
# named_scope :recent, lambda { { :conditions => ['created_at > ?', 1.week.ago] } }
|
6
6
|
# named_scope :newest, :order => "created_at DESC"
|
data/muck-engine.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{muck-engine}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.23"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Justin Ball", "Joel Duffin"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2010-01-06}
|
13
13
|
s.description = %q{The base engine for the muck system. Contains common tables, custom for, css and javascript.}
|
14
14
|
s.email = %q{justin@tatemae.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -180,6 +180,7 @@ Gem::Specification.new do |s|
|
|
180
180
|
"public/images/service_icons/16/diigo.png",
|
181
181
|
"public/images/service_icons/16/facebook.png",
|
182
182
|
"public/images/service_icons/16/feed.png",
|
183
|
+
"public/images/service_icons/16/fireeagle.png",
|
183
184
|
"public/images/service_icons/16/flickr.png",
|
184
185
|
"public/images/service_icons/16/fotolog.png",
|
185
186
|
"public/images/service_icons/16/friendfeed.png",
|
@@ -245,6 +246,7 @@ Gem::Specification.new do |s|
|
|
245
246
|
"public/images/service_icons/24/diigo.png",
|
246
247
|
"public/images/service_icons/24/facebook.png",
|
247
248
|
"public/images/service_icons/24/feed.png",
|
249
|
+
"public/images/service_icons/24/fireeagle.png",
|
248
250
|
"public/images/service_icons/24/flickr.png",
|
249
251
|
"public/images/service_icons/24/fotolog.png",
|
250
252
|
"public/images/service_icons/24/friendfeed.png",
|
@@ -310,6 +312,7 @@ Gem::Specification.new do |s|
|
|
310
312
|
"public/images/service_icons/48/diigo.png",
|
311
313
|
"public/images/service_icons/48/facebook.png",
|
312
314
|
"public/images/service_icons/48/feed.png",
|
315
|
+
"public/images/service_icons/48/fireeagle.png",
|
313
316
|
"public/images/service_icons/48/flickr.png",
|
314
317
|
"public/images/service_icons/48/fotolog.png",
|
315
318
|
"public/images/service_icons/48/friendfeed.png",
|
@@ -375,6 +378,7 @@ Gem::Specification.new do |s|
|
|
375
378
|
"public/images/service_icons/60/diigo.png",
|
376
379
|
"public/images/service_icons/60/facebook.png",
|
377
380
|
"public/images/service_icons/60/feed.png",
|
381
|
+
"public/images/service_icons/60/fireeagle.png",
|
378
382
|
"public/images/service_icons/60/flickr.png",
|
379
383
|
"public/images/service_icons/60/fotolog.png",
|
380
384
|
"public/images/service_icons/60/friendfeed.png",
|
@@ -452,6 +456,7 @@ Gem::Specification.new do |s|
|
|
452
456
|
"public/images/service_icons/source/diigo.png",
|
453
457
|
"public/images/service_icons/source/facebook.png",
|
454
458
|
"public/images/service_icons/source/feed.png",
|
459
|
+
"public/images/service_icons/source/fireeagle.psd",
|
455
460
|
"public/images/service_icons/source/flickr.png",
|
456
461
|
"public/images/service_icons/source/fotolog.png",
|
457
462
|
"public/images/service_icons/source/friendfeed.png",
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,14 +1,15 @@
|
|
1
1
|
development:
|
2
|
-
adapter:
|
3
|
-
database:
|
4
|
-
|
2
|
+
adapter: mysql
|
3
|
+
database: muck_engine_development
|
4
|
+
username: root
|
5
|
+
password:
|
6
|
+
host: localhost
|
7
|
+
encoding: utf8
|
5
8
|
|
6
9
|
test:
|
7
|
-
adapter:
|
8
|
-
database:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
database: db/production.sqlite3
|
14
|
-
timeout: 5000
|
10
|
+
adapter: mysql
|
11
|
+
database: muck_engine_test
|
12
|
+
username: root
|
13
|
+
password:
|
14
|
+
host: localhost
|
15
|
+
encoding: utf8
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muck-engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Ball
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date:
|
13
|
+
date: 2010-01-06 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -216,6 +216,7 @@ files:
|
|
216
216
|
- public/images/service_icons/16/diigo.png
|
217
217
|
- public/images/service_icons/16/facebook.png
|
218
218
|
- public/images/service_icons/16/feed.png
|
219
|
+
- public/images/service_icons/16/fireeagle.png
|
219
220
|
- public/images/service_icons/16/flickr.png
|
220
221
|
- public/images/service_icons/16/fotolog.png
|
221
222
|
- public/images/service_icons/16/friendfeed.png
|
@@ -281,6 +282,7 @@ files:
|
|
281
282
|
- public/images/service_icons/24/diigo.png
|
282
283
|
- public/images/service_icons/24/facebook.png
|
283
284
|
- public/images/service_icons/24/feed.png
|
285
|
+
- public/images/service_icons/24/fireeagle.png
|
284
286
|
- public/images/service_icons/24/flickr.png
|
285
287
|
- public/images/service_icons/24/fotolog.png
|
286
288
|
- public/images/service_icons/24/friendfeed.png
|
@@ -346,6 +348,7 @@ files:
|
|
346
348
|
- public/images/service_icons/48/diigo.png
|
347
349
|
- public/images/service_icons/48/facebook.png
|
348
350
|
- public/images/service_icons/48/feed.png
|
351
|
+
- public/images/service_icons/48/fireeagle.png
|
349
352
|
- public/images/service_icons/48/flickr.png
|
350
353
|
- public/images/service_icons/48/fotolog.png
|
351
354
|
- public/images/service_icons/48/friendfeed.png
|
@@ -411,6 +414,7 @@ files:
|
|
411
414
|
- public/images/service_icons/60/diigo.png
|
412
415
|
- public/images/service_icons/60/facebook.png
|
413
416
|
- public/images/service_icons/60/feed.png
|
417
|
+
- public/images/service_icons/60/fireeagle.png
|
414
418
|
- public/images/service_icons/60/flickr.png
|
415
419
|
- public/images/service_icons/60/fotolog.png
|
416
420
|
- public/images/service_icons/60/friendfeed.png
|
@@ -488,6 +492,7 @@ files:
|
|
488
492
|
- public/images/service_icons/source/diigo.png
|
489
493
|
- public/images/service_icons/source/facebook.png
|
490
494
|
- public/images/service_icons/source/feed.png
|
495
|
+
- public/images/service_icons/source/fireeagle.psd
|
491
496
|
- public/images/service_icons/source/flickr.png
|
492
497
|
- public/images/service_icons/source/fotolog.png
|
493
498
|
- public/images/service_icons/source/friendfeed.png
|