diaspora-vines 0.1.22 → 0.1.24

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/test/storage_test.rb DELETED
@@ -1,85 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- require 'storage_tests'
4
- require 'test_helper'
5
-
6
- describe Vines::Storage do
7
- ALICE = 'alice@wonderland.lit'.freeze
8
-
9
- class MockLdapStorage < Vines::Storage
10
- attr_reader :authenticate_calls, :find_user_calls, :save_user_calls
11
-
12
- def initialize(found_user=nil)
13
- @found_user = found_user
14
- @authenticate_calls = @find_user_calls = @save_user_calls = 0
15
- @ldap = Class.new do
16
- attr_accessor :user, :auth
17
- def authenticate(username, password)
18
- @auth ||= []
19
- @auth << [username, password]
20
- @user
21
- end
22
- end.new
23
- end
24
-
25
- def authenticate(username, password)
26
- @authenticate_calls += 1
27
- nil
28
- end
29
- wrap_ldap :authenticate
30
-
31
- def find_user(jid)
32
- @find_user_calls += 1
33
- @found_user
34
- end
35
-
36
- def save_user(user)
37
- @save_user_calls += 1
38
- end
39
- end
40
-
41
- describe '#authenticate_with_ldap' do
42
- it 'fails when given a bad password' do
43
- StorageTests::EMLoop.new do
44
- storage = MockLdapStorage.new
45
- storage.ldap.user = nil
46
- user = storage.authenticate(ALICE, 'bogus')
47
- assert_nil user
48
- assert_equal 0, storage.authenticate_calls
49
- assert_equal 0, storage.find_user_calls
50
- assert_equal 0, storage.save_user_calls
51
- assert_equal [ALICE, 'bogus'], storage.ldap.auth.first
52
- end
53
- end
54
-
55
- it 'succeeds when user exists in database' do
56
- StorageTests::EMLoop.new do
57
- alice = Vines::User.new(:jid => ALICE)
58
- storage = MockLdapStorage.new(alice)
59
- storage.ldap.user = alice
60
- user = storage.authenticate(ALICE, 'secr3t')
61
- refute_nil user
62
- assert_equal ALICE, user.jid.to_s
63
- assert_equal 0, storage.authenticate_calls
64
- assert_equal 1, storage.find_user_calls
65
- assert_equal 0, storage.save_user_calls
66
- assert_equal [ALICE, 'secr3t'], storage.ldap.auth.first
67
- end
68
- end
69
-
70
- it 'succeeds and saves user to the database' do
71
- StorageTests::EMLoop.new do
72
- alice = Vines::User.new(:jid => ALICE)
73
- storage = MockLdapStorage.new
74
- storage.ldap.user = alice
75
- user = storage.authenticate(ALICE, 'secr3t')
76
- refute_nil user
77
- assert_equal ALICE, user.jid.to_s
78
- assert_equal 0, storage.authenticate_calls
79
- assert_equal 1, storage.find_user_calls
80
- assert_equal 1, storage.save_user_calls
81
- assert_equal [ALICE, 'secr3t'], storage.ldap.auth.first
82
- end
83
- end
84
- end
85
- end
data/vines.gemspec DELETED
@@ -1,34 +0,0 @@
1
- require './lib/vines/version'
2
-
3
- Gem::Specification.new do |s|
4
- s.name = 'diaspora-vines'
5
- s.version = Vines::VERSION
6
- s.summary = %q[Diaspora-vines is a Vines fork build for diaspora integration.]
7
- s.description = %q[Diaspora-vines is a Vines fork build for diaspora integration. DO NOT use it unless you know what you are doing!]
8
-
9
- s.authors = ['David Graham','Lukas Matt']
10
- s.email = ['david@negativecode.com','lukas@zauberstuhl.de']
11
- s.homepage = 'https://diasporafoundation.org'
12
- s.license = 'MIT'
13
-
14
- s.files = Dir['[A-Z]*', 'vines.gemspec', '{bin,lib,conf,web}/**/*'] - ['Gemfile.lock']
15
- s.test_files = Dir['test/**/*']
16
- s.executables = %w[vines]
17
- s.require_path = 'lib'
18
-
19
- s.add_dependency 'bcrypt', '~> 3.1'
20
- s.add_dependency 'em-hiredis', '~> 0.1.1'
21
- s.add_dependency 'eventmachine', '~> 1.0'
22
- s.add_dependency 'http_parser.rb', '~> 0.6'
23
- s.add_dependency 'net-ldap', '~> 0.6'
24
- s.add_dependency 'nokogiri', '~> 1.6'
25
- s.add_dependency 'activerecord', '~> 4.1.4'
26
-
27
-
28
- s.add_development_dependency 'rails', '~> 4.1.4'
29
- s.add_development_dependency 'sqlite3', '~> 1.3.9'
30
- s.add_development_dependency 'minitest', '~> 5.3'
31
- s.add_development_dependency 'rake', '~> 10.3'
32
-
33
- s.required_ruby_version = '>= 1.9.3'
34
- end