muck-friends 0.1.15 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -57,4 +57,4 @@ and a user model thus:
57
57
  end
58
58
 
59
59
 
60
- Copyright (c) 2009 Justin Ball, released under the MIT license
60
+ Copyright (c) 2009 Tatemae, released under the MIT license
data/Rakefile CHANGED
@@ -50,10 +50,10 @@ begin
50
50
  Jeweler::Tasks.new do |gemspec|
51
51
  gemspec.name = "muck-friends"
52
52
  gemspec.summary = "Friends engine for the muck system"
53
- gemspec.email = "justinball@gmail.com"
54
- gemspec.homepage = "http://github.com/jbasdf/muck_friends"
53
+ gemspec.email = "justin@tatemae.com"
54
+ gemspec.homepage = "http://github.com/tatemae/muck_friends"
55
55
  gemspec.description = "Friend engine for the muck system."
56
- gemspec.authors = ["Justin Ball"]
56
+ gemspec.authors = ["Justin Ball", "Joel Duffin"]
57
57
  gemspec.rubyforge_project = 'muck-friends'
58
58
  gemspec.add_dependency "muck-engine"
59
59
  gemspec.add_dependency "muck-users"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.15
1
+ 0.1.16
data/muck-friends.gemspec CHANGED
@@ -5,13 +5,13 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{muck-friends}
8
- s.version = "0.1.15"
8
+ s.version = "0.1.16"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Justin Ball"]
12
- s.date = %q{2009-11-10}
11
+ s.authors = ["Justin Ball", "Joel Duffin"]
12
+ s.date = %q{2009-11-13}
13
13
  s.description = %q{Friend engine for the muck system.}
14
- s.email = %q{justinball@gmail.com}
14
+ s.email = %q{justin@tatemae.com}
15
15
  s.extra_rdoc_files = [
16
16
  "README.rdoc"
17
17
  ]
@@ -94,7 +94,6 @@ Gem::Specification.new do |s|
94
94
  "tasks/rails.rake",
95
95
  "test/rails_root/.gitignore",
96
96
  "test/rails_root/.rake_tasks",
97
- "test/rails_root/Capfile",
98
97
  "test/rails_root/Rakefile",
99
98
  "test/rails_root/app/controllers/application_controller.rb",
100
99
  "test/rails_root/app/controllers/default_controller.rb",
@@ -316,18 +315,10 @@ Gem::Specification.new do |s|
316
315
  "test/rails_root/script/process/spawner",
317
316
  "test/rails_root/script/runner",
318
317
  "test/rails_root/script/server",
319
- "test/rails_root/test/factories.rb",
320
318
  "test/rails_root/test/functional/.keep",
321
319
  "test/rails_root/test/functional/default_controller_test.rb",
322
320
  "test/rails_root/test/functional/friends_controller_test.rb",
323
321
  "test/rails_root/test/integration/.keep",
324
- "test/rails_root/test/mocks/development/.keep",
325
- "test/rails_root/test/mocks/test/.keep",
326
- "test/rails_root/test/shoulda_macros/controller.rb",
327
- "test/rails_root/test/shoulda_macros/forms.rb",
328
- "test/rails_root/test/shoulda_macros/models.rb",
329
- "test/rails_root/test/shoulda_macros/pagination.rb",
330
- "test/rails_root/test/shoulda_macros/plugins.rb",
331
322
  "test/rails_root/test/test_helper.rb",
332
323
  "test/rails_root/test/unit/.keep",
333
324
  "test/rails_root/test/unit/friend_mailer_test.rb",
@@ -338,7 +329,7 @@ Gem::Specification.new do |s|
338
329
  "test/rails_root/vendor/plugins/ssl_requirement/test/ssl_requirement_test.rb",
339
330
  "uninstall.rb"
340
331
  ]
341
- s.homepage = %q{http://github.com/jbasdf/muck_friends}
332
+ s.homepage = %q{http://github.com/tatemae/muck_friends}
342
333
  s.rdoc_options = ["--charset=UTF-8"]
343
334
  s.require_paths = ["lib"]
344
335
  s.rubyforge_project = %q{muck-friends}
@@ -378,14 +369,8 @@ Gem::Specification.new do |s|
378
369
  "test/rails_root/features/support/paths.rb",
379
370
  "test/rails_root/public/dispatch.rb",
380
371
  "test/rails_root/script/create_project.rb",
381
- "test/rails_root/test/factories.rb",
382
372
  "test/rails_root/test/functional/default_controller_test.rb",
383
373
  "test/rails_root/test/functional/friends_controller_test.rb",
384
- "test/rails_root/test/shoulda_macros/controller.rb",
385
- "test/rails_root/test/shoulda_macros/forms.rb",
386
- "test/rails_root/test/shoulda_macros/models.rb",
387
- "test/rails_root/test/shoulda_macros/pagination.rb",
388
- "test/rails_root/test/shoulda_macros/plugins.rb",
389
374
  "test/rails_root/test/test_helper.rb",
390
375
  "test/rails_root/test/unit/friend_mailer_test.rb",
391
376
  "test/rails_root/test/unit/friend_test.rb",
@@ -15,7 +15,7 @@ end
15
15
 
16
16
  Rails::Initializer.run do |config|
17
17
  config.time_zone = 'UTC'
18
- config.gem 'mislav-will_paginate', :lib => 'will_paginate', :source => 'http://gems.github.com'
18
+ config.gem "will_paginate"
19
19
  config.gem "authlogic"
20
20
  config.gem "bcrypt-ruby", :lib => "bcrypt"
21
21
  config.gem 'thoughtbot-paperclip', :lib => 'paperclip', :source => "http://gems.github.com"
@@ -22,13 +22,3 @@ config.action_controller.allow_forgery_protection = false
22
22
  config.action_mailer.delivery_method = :test
23
23
 
24
24
  HOST = "localhost"
25
-
26
- config.gem 'thoughtbot-shoulda',
27
- :lib => 'shoulda',
28
- :source => "http://gems.github.com",
29
- :version => '>= 2.9.1'
30
- config.gem 'thoughtbot-factory_girl',
31
- :lib => 'factory_girl',
32
- :source => "http://gems.github.com",
33
- :version => '>= 1.2.0'
34
- config.gem "rcov", :version => '>=0.8.1.2.0'
@@ -1,4 +1,8 @@
1
1
  ActionController::Routing::Routes.draw do |map|
2
+
3
+ map.home '', :controller => 'default', :action => 'index'
4
+ map.root :controller => 'default', :action => 'index'
5
+
2
6
  map.connect ':controller/:action/:id'
3
7
  map.connect ':controller/:action/:id.:format'
4
8
 
@@ -1,38 +1,11 @@
1
1
  $:.reject! { |e| e.include? 'TextMate' }
2
2
  ENV["RAILS_ENV"] = "test"
3
3
  require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
4
- require 'test_help'
5
- gem 'thoughtbot-factory_girl' # from github
6
- require 'factory_girl'
7
- require 'mocha'
4
+ gem 'muck-engine'
5
+ require 'muck_test_helper'
8
6
  require 'authlogic/test_case'
9
- require 'redgreen' rescue LoadError
10
- require File.expand_path(File.dirname(__FILE__) + '/factories')
11
- require File.join(File.dirname(__FILE__), 'shoulda_macros', 'controller')
12
- require File.join(File.dirname(__FILE__), 'shoulda_macros', 'models')
13
-
14
- class ActiveSupport::TestCase
15
- self.use_transactional_fixtures = true
16
- self.use_instantiated_fixtures = false
17
7
 
8
+ class ActiveSupport::TestCase
9
+ include MuckTestMethods
18
10
  include Authlogic::TestCase
19
-
20
- def login_as(user)
21
- success = UserSession.create(user)
22
- if !success
23
- errors = user.errors.full_messages.to_sentence
24
- message = 'User has not been activated' if !user.active?
25
- raise "could not login as #{user.to_param}. Please make sure the user is valid. #{message} #{errors}"
26
- end
27
- UserSession.find
28
- end
29
-
30
- def assure_logout
31
- user_session = UserSession.find
32
- user_session.destroy if user_session
33
- end
34
-
35
- def ensure_flash(val)
36
- assert_contains flash.values, val, ", Flash: #{flash.inspect}"
37
- end
38
11
  end
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muck-friends
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Ball
8
+ - Joel Duffin
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
12
 
12
- date: 2009-11-10 00:00:00 -07:00
13
+ date: 2009-11-13 00:00:00 -07:00
13
14
  default_executable:
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
@@ -43,7 +44,7 @@ dependencies:
43
44
  version: "0"
44
45
  version:
45
46
  description: Friend engine for the muck system.
46
- email: justinball@gmail.com
47
+ email: justin@tatemae.com
47
48
  executables: []
48
49
 
49
50
  extensions: []
@@ -129,7 +130,6 @@ files:
129
130
  - tasks/rails.rake
130
131
  - test/rails_root/.gitignore
131
132
  - test/rails_root/.rake_tasks
132
- - test/rails_root/Capfile
133
133
  - test/rails_root/Rakefile
134
134
  - test/rails_root/app/controllers/application_controller.rb
135
135
  - test/rails_root/app/controllers/default_controller.rb
@@ -351,18 +351,10 @@ files:
351
351
  - test/rails_root/script/process/spawner
352
352
  - test/rails_root/script/runner
353
353
  - test/rails_root/script/server
354
- - test/rails_root/test/factories.rb
355
354
  - test/rails_root/test/functional/.keep
356
355
  - test/rails_root/test/functional/default_controller_test.rb
357
356
  - test/rails_root/test/functional/friends_controller_test.rb
358
357
  - test/rails_root/test/integration/.keep
359
- - test/rails_root/test/mocks/development/.keep
360
- - test/rails_root/test/mocks/test/.keep
361
- - test/rails_root/test/shoulda_macros/controller.rb
362
- - test/rails_root/test/shoulda_macros/forms.rb
363
- - test/rails_root/test/shoulda_macros/models.rb
364
- - test/rails_root/test/shoulda_macros/pagination.rb
365
- - test/rails_root/test/shoulda_macros/plugins.rb
366
358
  - test/rails_root/test/test_helper.rb
367
359
  - test/rails_root/test/unit/.keep
368
360
  - test/rails_root/test/unit/friend_mailer_test.rb
@@ -373,7 +365,7 @@ files:
373
365
  - test/rails_root/vendor/plugins/ssl_requirement/test/ssl_requirement_test.rb
374
366
  - uninstall.rb
375
367
  has_rdoc: true
376
- homepage: http://github.com/jbasdf/muck_friends
368
+ homepage: http://github.com/tatemae/muck_friends
377
369
  licenses: []
378
370
 
379
371
  post_install_message:
@@ -434,14 +426,8 @@ test_files:
434
426
  - test/rails_root/features/support/paths.rb
435
427
  - test/rails_root/public/dispatch.rb
436
428
  - test/rails_root/script/create_project.rb
437
- - test/rails_root/test/factories.rb
438
429
  - test/rails_root/test/functional/default_controller_test.rb
439
430
  - test/rails_root/test/functional/friends_controller_test.rb
440
- - test/rails_root/test/shoulda_macros/controller.rb
441
- - test/rails_root/test/shoulda_macros/forms.rb
442
- - test/rails_root/test/shoulda_macros/models.rb
443
- - test/rails_root/test/shoulda_macros/pagination.rb
444
- - test/rails_root/test/shoulda_macros/plugins.rb
445
431
  - test/rails_root/test/test_helper.rb
446
432
  - test/rails_root/test/unit/friend_mailer_test.rb
447
433
  - test/rails_root/test/unit/friend_test.rb
@@ -1,3 +0,0 @@
1
- load 'deploy' if respond_to?(:namespace) # cap2 differentiator
2
- Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
3
- load 'config/deploy'
@@ -1,50 +0,0 @@
1
- Factory.sequence :email do |n|
2
- "somebody#{n}@example.com"
3
- end
4
-
5
- Factory.sequence :login do |n|
6
- "inquire#{n}"
7
- end
8
-
9
- Factory.sequence :name do |n|
10
- "a_name#{n}"
11
- end
12
-
13
- Factory.sequence :abbr do |n|
14
- "abbr#{n}"
15
- end
16
-
17
- Factory.sequence :description do |n|
18
- "This is the description: #{n}"
19
- end
20
-
21
- Factory.define :state do |f|
22
- f.name { Factory.next(:name) }
23
- f.abbreviation { Factory.next(:abbr) }
24
- f.country {|a| a.association(:country) }
25
- end
26
-
27
- Factory.define :country do |f|
28
- f.name { Factory.next(:name) }
29
- f.abbreviation { Factory.next(:abbr) }
30
- end
31
-
32
- Factory.define :user do |f|
33
- f.login { Factory.next(:login) }
34
- f.email { Factory.next(:email) }
35
- f.password 'inquire_pass'
36
- f.password_confirmation 'inquire_pass'
37
- f.first_name 'test'
38
- f.last_name 'guy'
39
- f.terms_of_service true
40
- f.activated_at DateTime.now
41
- end
42
-
43
- Factory.define :permission do |f|
44
- f.role {|a| a.association(:role)}
45
- f.user {|a| a.association(:user)}
46
- end
47
-
48
- Factory.define :role do |f|
49
- f.rolename 'administrator'
50
- end
File without changes
File without changes
@@ -1,45 +0,0 @@
1
- module MuckControllerMacros
2
-
3
- def should_require_login(*args)
4
- args = Hash[*args]
5
- login_url = args.delete :login_url
6
- args.each do |action, verb|
7
- should "Require login for '#{action}' action" do
8
- send(verb, action)
9
- assert_redirected_to(login_url)
10
- end
11
- end
12
- end
13
-
14
- def should_require_role(role, redirect_url, *actions)
15
- actions.each do |action|
16
- should "require role for '#{action}' action" do
17
- get(action)
18
- ensure_flash(/permission/i)
19
- assert_response :redirect
20
- end
21
- end
22
- end
23
-
24
- #from: http://blog.internautdesign.com/2008/9/11/more-on-custom-shoulda-macros-scoping-of-instance-variables
25
- def should_not_allow action, object, url= "/login", msg=nil
26
- msg ||= "a #{object.class.to_s.downcase}"
27
- should "not be able to #{action} #{msg}" do
28
- object = eval(object, self.send(:binding), __FILE__, __LINE__)
29
- get action, :id => object.id
30
- assert_redirected_to url
31
- end
32
- end
33
-
34
- def should_allow action, object, msg=nil
35
- msg ||= "a #{object.class.to_s.downcase}"
36
- should "be able to #{action} #{msg}" do
37
- object = eval(object, self.send(:binding), __FILE__, __LINE__)
38
- get action, :id => object.id
39
- assert_response :success
40
- end
41
- end
42
-
43
- end
44
-
45
- ActionController::TestCase.extend(MuckControllerMacros)
@@ -1,32 +0,0 @@
1
- module ShouldaFormMacros
2
- def self.should_have_form(opts)
3
- model = self.name.gsub(/ControllerTest$/, '').singularize.downcase
4
- model = model[model.rindex('::')+2..model.size] if model.include?('::')
5
- http_method, hidden_http_method = form_http_method opts[:method]
6
- should "have a #{model} form" do
7
- assert_select "form[action=?][method=#{http_method}]", eval(opts[:action]) do
8
- if hidden_http_method
9
- assert_select "input[type=hidden][name=_method][value=#{hidden_http_method}]"
10
- end
11
- opts[:fields].each do |attribute, type|
12
- attribute = attribute.is_a?(Symbol) ? "#{model}[#{attribute.to_s}]" : attribute
13
- assert_select "input[type=#{type.to_s}][name=?]", attribute
14
- end
15
- assert_select "input[type=submit]"
16
- end
17
- end
18
- end
19
-
20
- def self.form_http_method(http_method)
21
- http_method = http_method.nil? ? 'post' : http_method.to_s
22
- if http_method == "post" || http_method == "get"
23
- return http_method, nil
24
- else
25
- return "post", http_method
26
- end
27
- end
28
- end
29
-
30
- class ActiveSupport::TestCase
31
- extend ShouldaFormMacros
32
- end
@@ -1,50 +0,0 @@
1
- module ShouldaModelMacros
2
-
3
- def self.should_whitelist(*attributes)
4
- bad_scripts = [
5
- %|';alert(String.fromCharCode(88,83,83))//\';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//\";alert(String.fromCharCode(88,83,83))//--></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>|,
6
- %|'';!--"<XSS>=&{()}|,
7
- %|<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>|,
8
- %|<IMG SRC="javascript:alert('XSS');">|,
9
- %|<IMG SRC=javascript:alert('XSS')>|,
10
- %|<IMG SRC=JaVaScRiPt:alert('XSS')>|,
11
- %|<IMG SRC=JaVaScRiPt:alert('XSS')>|,
12
- %|<IMG SRC=`javascript:alert("RSnake says, 'XSS'")`>|,
13
- %|<IMG """><SCRIPT>alert("XSS")</SCRIPT>">|,
14
- %|<IMG SRC=javascript:alert(String.fromCharCode(88,83,83))>|,
15
- %|<A HREF="h
16
- tt p://6&#9;6.000146.0x7.147/">XSS</A>|,
17
- %|<script>alert('message');</script>| ]
18
-
19
- klass = model_class
20
- attributes.each do |attribute|
21
- attribute = attribute.to_sym
22
- should "white list #{attribute}" do
23
- assert object = klass.find(:first), "Can't find first #{klass}"
24
- bad_scripts.each do |bad_value|
25
- object.send("#{attribute}=", bad_value)
26
- object.save
27
- clean_value = object.send("#{attribute}")
28
- assert !clean_value.include?(bad_value), "#{attribute} is not white listed. #{bad_value} made it through"
29
- end
30
- end
31
- end
32
- end
33
-
34
- def should_accept_nested_attributes_for(*attr_names)
35
- klass = self.name.gsub(/Test$/, '').constantize
36
-
37
- context "#{klass}" do
38
- attr_names.each do |association_name|
39
- should "accept nested attrs for #{association_name}" do
40
- assert klass.instance_methods.include?("#{association_name}_attributes="),
41
- "#{klass} does not accept nested attributes for #{association_name}"
42
- end
43
- end
44
- end
45
- end
46
- end
47
-
48
- class ActiveSupport::TestCase
49
- extend ShouldaModelMacros
50
- end
@@ -1,53 +0,0 @@
1
- module ShouldaPaginationMacros
2
- # Example:
3
- # context "a GET to index logged in as admin" do
4
- # setup do
5
- # login_as_admin
6
- # get :index
7
- # end
8
- # should_paginate_collection :users
9
- # should_display_pagination
10
- # end
11
- def self.should_paginate_collection(collection_name)
12
- should "paginate #{collection_name}" do
13
- assert collection = assigns(collection_name),
14
- "Controller isn't assigning to @#{collection_name.to_s}."
15
- assert_kind_of WillPaginate::Collection, collection,
16
- "@#{collection_name.to_s} isn't a WillPaginate collection."
17
- end
18
- end
19
-
20
- def self.should_display_pagination
21
- should "display pagination" do
22
- assert_select "div.pagination", { :minimum => 1 },
23
- "View isn't displaying pagination. Add <%= will_paginate @collection %>."
24
- end
25
- end
26
-
27
- # Example:
28
- # context "a GET to index not logged in as admin" do
29
- # setup { get :index }
30
- # should_not_paginate_collection :users
31
- # should_not_display_pagination
32
- # end
33
- def self.should_not_paginate_collection(collection_name)
34
- should "not paginate #{collection_name}" do
35
- assert collection = assigns(collection_name),
36
- "Controller isn't assigning to @#{collection_name.to_s}."
37
- assert_not_equal WillPaginate::Collection, collection.class,
38
- "@#{collection_name.to_s} is a WillPaginate collection."
39
- end
40
- end
41
-
42
- def self.should_not_display_pagination
43
- should "not display pagination" do
44
- assert_select "div.pagination", { :count => 0 },
45
- "View is displaying pagination. Check your logic."
46
- end
47
- end
48
- end
49
-
50
-
51
- class ActiveSupport::TestCase
52
- extend ShouldaPaginationMacros
53
- end
@@ -1,34 +0,0 @@
1
- module ShouldaPluginMacros
2
-
3
- def self.should_act_as_taggable_on_steroids
4
- klass = self.name.gsub(/Test$/, '').constantize
5
-
6
- should "include ActsAsTaggableOnSteroids methods" do
7
- assert klass.extended_by.include?(ActiveRecord::Acts::Taggable::ClassMethods)
8
- assert klass.extended_by.include?(ActiveRecord::Acts::Taggable::SingletonMethods)
9
- assert klass.include?(ActiveRecord::Acts::Taggable::InstanceMethods)
10
- end
11
-
12
- should_have_many :taggings, :tags
13
- end
14
-
15
-
16
- def self.should_act_as_list
17
- klass = self.name.gsub(/Test$/, '').constantize
18
-
19
- context "To support acts_as_list" do
20
- should_have_db_column('position', :type => :integer)
21
- end
22
-
23
- should "include ActsAsList methods" do
24
- assert klass.include?(ActiveRecord::Acts::List::InstanceMethods)
25
- end
26
-
27
- should_have_instance_methods :acts_as_list_class, :position_column, :scope_condition
28
- end
29
-
30
- end
31
-
32
- ActiveSupport::TestCase.extend(ShouldaPluginMacros)
33
- Test::Unit::TestCase.extend(ShouldaPluginMacros)
34
- ActionController::TestCase.extend(ShouldaPluginMacros)