remote_factory_girl 1.0.1 → 1.0.2

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: d8b42f8eed81c36f43aae8e0965e146f7a6882ee
4
- data.tar.gz: 4aed3ffaff3534cd3fe42d1556636e9b3632431b
3
+ metadata.gz: 568879d0cb0a73b0a0b4cfbc8d24a7e55db06052
4
+ data.tar.gz: 050ebe624b42a226271972e4174d635750a1b998
5
5
  SHA512:
6
- metadata.gz: 5101e0ebec7e4b744df4971682aebb58d642ddade2445af34d9fc52d5029f8523163d746c734e93bf9840e1f6e5d95f936970418ddff42c6b9851a82b54c6acd
7
- data.tar.gz: 5f7c90c31af76477fff52c6d57cb633ad1523451dfc5e98f972f180725fd5c4f33fea261e0a129024090eb2f3e1227283f02599a77624b3a6389f8c00e9a4273
6
+ metadata.gz: 7b9105b90699050925579b0e0dc4fd9b7af917f6c6073b1f90798ab9c9ac030627b12f5d7169adf05677b984e8cdc0541a8ffb1af3c1923fac5a0f1f789d2311
7
+ data.tar.gz: 6d1c20f5438cb6eebdb16f019415843c628ff4c43267c9c85a422e1f55eb27521fb2bc9a407ea5f3bb62482070b477598127a91fa854074c04ffab9709af5f92
data/.rspec CHANGED
@@ -1,2 +1 @@
1
1
  --color
2
- --default_path spec
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ### 1.0.2 - Aug. 19, 2014
2
+ 1. Update specs to use Rspec '3.0.0' syntax
3
+
data/Gemfile CHANGED
@@ -7,5 +7,5 @@ gem 'rest-client' # http
7
7
  # Specify your gem's dependencies in remote_factory_girl.gemspec
8
8
  gemspec
9
9
 
10
- gem 'rspec'
10
+ gem 'rspec', '~> 3.0.0'
11
11
  gem 'pry'
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # RemoteFactoryGirl
2
2
 
3
- [factory_girl](https://github.com/thoughtbot/factory_girl) for [Service Oriented Architecture](http://en.wikipedia.org/wiki/Service-oriented_architecture) (SOA). Create [factory_girl](https://github.com/thoughtbot/factory_girl) test data remotely when used in conjunction with [remote_factory_girl_home_rails](https://github.com/tdouce/remote_factory_girl_home_rails).
3
+ [factory_girl](https://github.com/thoughtbot/factory_girl) for [Service Oriented Architecture](http://en.wikipedia.org/wiki/Service-oriented_architecture) (SOA). Create test data with [factory_girl](https://github.com/thoughtbot/factory_girl) remotely when used in conjunction with [remote_factory_girl_home_rails](https://github.com/tdouce/remote_factory_girl_home_rails).
4
4
 
5
5
  ## Getting Started
6
6
 
@@ -14,8 +14,13 @@ See [GETTING_STARTED](https://github.com/tdouce/remote_factory_girl/wiki/Getting
14
14
 
15
15
  ## Contributing
16
16
 
17
- 1. Fork it ( http://github.com/<my-github-username>/remote_factory_girl/fork )
17
+ 1. Fork it ( http://github.com/tdouce/remote_factory_girl/fork )
18
18
  2. Create your feature branch (`git checkout -b my-new-feature`)
19
19
  3. Commit your changes (`git commit -am 'Add some feature'`)
20
20
  4. Push to the branch (`git push origin my-new-feature`)
21
21
  5. Create new Pull Request
22
+
23
+ ## TODOS
24
+
25
+ 1. Allow remote_factory_girl to configure multiple "homes" (external services) so that
26
+ remote_factory_girl can create test data in multiple "homes"s.
@@ -1,3 +1,3 @@
1
1
  module RemoteFactoryGirl
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -10,9 +10,9 @@ describe RemoteFactoryGirl do
10
10
  :port => nil,
11
11
  :end_point => '/remote_factory_girl/home'})
12
12
  expect(RemoteFactoryGirl.config.return_response_as).to eq(:as_hash)
13
- expect(RemoteFactoryGirl.config.return_with_root).to be_true
14
- expect(RemoteFactoryGirl.config.return_as_active_resource).to be_false
15
- expect(RemoteFactoryGirl.config.https).to be_false
13
+ expect(RemoteFactoryGirl.config.return_with_root).to eq true
14
+ expect(RemoteFactoryGirl.config.return_as_active_resource).to eq false
15
+ expect(RemoteFactoryGirl.config.https).to eq false
16
16
  end
17
17
 
18
18
  it 'should be able to configure with a block' do
@@ -37,17 +37,17 @@ describe RemoteFactoryGirl do
37
37
 
38
38
  it 'should be able to configure .return_with_root' do
39
39
  RemoteFactoryGirl.config.return_with_root = false
40
- expect(RemoteFactoryGirl.config.return_with_root).to be_false
40
+ expect(RemoteFactoryGirl.config.return_with_root).to eq false
41
41
  end
42
42
 
43
43
  it 'should be able to configure .return_as_active_resource' do
44
44
  RemoteFactoryGirl.config.return_as_active_resource = true
45
- expect(RemoteFactoryGirl.config.return_as_active_resource).to be_true
45
+ expect(RemoteFactoryGirl.config.return_as_active_resource).to eq true
46
46
  end
47
47
 
48
48
  it 'should be able to configure https' do
49
49
  RemoteFactoryGirl.config.https = true
50
- expect(RemoteFactoryGirl.config.https).to be_true
50
+ expect(RemoteFactoryGirl.config.https).to eq true
51
51
  end
52
52
  end
53
53
 
@@ -66,8 +66,8 @@ describe RemoteFactoryGirl do
66
66
  describe 'creating a remote factory' do
67
67
 
68
68
  before do
69
- RestClient.stub(:post).and_return('{"user": {"id": "1", "first_name": "Sam", "last_name": "Iam"}}')
70
- RestClient.stub(:get).and_return('["user", "user_admin"]')
69
+ allow(RestClient).to receive(:post).and_return('{"user": {"id": "1", "first_name": "Sam", "last_name": "Iam"}}')
70
+ allow(RestClient).to receive(:get).and_return('["user", "user_admin"]')
71
71
  end
72
72
 
73
73
  describe '.factories' do
@@ -5,7 +5,7 @@ require 'ostruct'
5
5
  describe RemoteFactoryGirl::ConfigApplier do
6
6
 
7
7
  describe '.post' do
8
- let(:json) {
8
+ let(:json) {
9
9
  { :user => { :first_name => "Sam", :last_name => "Iam"}}
10
10
  }
11
11
  let(:hash_to_dot_klass) { double('RemoteFactoryGirl::HashToDot') }
@@ -42,20 +42,20 @@ describe RemoteFactoryGirl::ConfigApplier do
42
42
  end
43
43
 
44
44
  it 'should return an object that responds to dot notation' do
45
- hash_to_dot_klass.stub(:convert).and_return(dish_json_with_user)
45
+ allow(hash_to_dot_klass).to receive(:convert).and_return(dish_json_with_user)
46
46
  response = RemoteFactoryGirl::ConfigApplier.apply_config(json, :return_response_as => :dot_notation,
47
47
  :hash_to_dot_klass => hash_to_dot_klass)
48
- expect(response.user.first_name).to eq('Sam')
48
+ expect(response.user.first_name).to eq('Sam')
49
49
  end
50
50
 
51
51
  it 'should not return root hash key and should return an object that responds to dot notation' do
52
52
  factory_girl_json_parser = double('RemoteFactoryGirl::FactoryGirlJsonParser', without_root: { :first_name => 'Sam', :last_name => 'Iam'})
53
- hash_to_dot_klass.stub(:convert).and_return(dot_notation_without_root)
54
- response = RemoteFactoryGirl::ConfigApplier.apply_config(json, :return_response_as => :dot_notation,
53
+ allow(hash_to_dot_klass).to receive(:convert).and_return(dot_notation_without_root)
54
+ response = RemoteFactoryGirl::ConfigApplier.apply_config(json, :return_response_as => :dot_notation,
55
55
  :return_with_root => false,
56
56
  :hash_to_dot_klass => hash_to_dot_klass,
57
57
  :factory_girl_json_parser => factory_girl_json_parser)
58
- expect(response.first_name).to eq('Sam')
58
+ expect(response.first_name).to eq('Sam')
59
59
  end
60
60
  end
61
61
 
@@ -63,7 +63,7 @@ describe RemoteFactoryGirl::ConfigApplier do
63
63
  it 'should return an active resource object' do
64
64
  json_to_active_resource_klass = double('RemoteFactoryGirl::JsonToActiveResource')
65
65
  expect(json_to_active_resource_klass).to receive(:convert).with(json)
66
- RemoteFactoryGirl::ConfigApplier.apply_config(json, :return_as_active_resource => true,
66
+ RemoteFactoryGirl::ConfigApplier.apply_config(json, :return_as_active_resource => true,
67
67
  :json_to_active_resource_klass => json_to_active_resource_klass)
68
68
  end
69
69
  end
@@ -15,9 +15,9 @@ describe RemoteFactoryGirl::Config do
15
15
  :port => nil,
16
16
  :end_point => '/remote_factory_girl/home'})
17
17
  expect(config.return_response_as).to eq(:as_hash)
18
- expect(config.return_with_root).to be_true
19
- expect(config.return_as_active_resource).to be_false
20
- expect(config.https).to be_false
18
+ expect(config.return_with_root).to eq true
19
+ expect(config.return_as_active_resource).to eq false
20
+ expect(config.https).to eq false
21
21
  end
22
22
  end
23
23
  end
@@ -49,17 +49,17 @@ describe RemoteFactoryGirl::Config do
49
49
  it 'should return false when host and end_point are not set' do
50
50
  config.home[:host] = nil
51
51
  config.home[:end_point] = nil
52
- expect(config.has_home?).to be_false
52
+ expect(config.has_home?).to eq false
53
53
  end
54
54
 
55
55
  it 'should return false when host is not set and end_point is set' do
56
- expect(config.has_home?).to be_false
56
+ expect(config.has_home?).to eq false
57
57
  end
58
58
 
59
59
  it 'should return true when host and end_point is set' do
60
60
  config.home[:host] = 'localhost'
61
61
  config.home[:end_point] = 'some_where'
62
- expect(config.has_home?).to be_true
62
+ expect(config.has_home?).to eq true
63
63
  end
64
64
  end
65
65
 
@@ -9,14 +9,14 @@ describe RemoteFactoryGirl::Http do
9
9
  let(:rest_client) { double('RestClient') }
10
10
 
11
11
  it 'should raise no host config errors' do
12
- rest_client.stub(:post).with(config.home_url, params, content_type: :json, accept: :json).and_return(true)
13
12
  expect(config).to receive(:raise_if_host_not_set)
13
+ allow(rest_client).to receive(:post).with(config.home_url, params, content_type: :json, accept: :json).and_return(true)
14
14
  RemoteFactoryGirl::Http.post(config, params, rest_client)
15
15
  end
16
16
 
17
17
  it 'should send http request to home_url with params' do
18
- config.stub(:raise_if_host_not_set)
19
18
  expect(rest_client).to receive(:post).with(config.home_url, params, content_type: :json, accept: :json)
19
+ allow(config).to receive(:raise_if_host_not_set)
20
20
  RemoteFactoryGirl::Http.post(config, params, rest_client)
21
21
  end
22
22
  end
@@ -13,7 +13,7 @@ describe RemoteFactoryGirl do
13
13
  end
14
14
  end
15
15
 
16
- it 'should be able to configure with a block' do
16
+ xit 'should be able to configure with a block' do
17
17
  pending
18
18
  end
19
19
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remote_factory_girl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - tdouce
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-30 00:00:00.000000000 Z
11
+ date: 2014-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -75,6 +75,7 @@ extra_rdoc_files: []
75
75
  files:
76
76
  - ".gitignore"
77
77
  - ".rspec"
78
+ - CHANGELOG.md
78
79
  - Gemfile
79
80
  - LICENSE.txt
80
81
  - README.md