magic_lamp 1.4.0 → 1.4.1
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.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/VERSION +1 -1
- data/app/assets/javascripts/magic_lamp/genie.js +1 -1
- data/lib/magic_lamp/fixture_creator.rb +16 -2
- data/spec/dummy/log/development.log +7320 -0
- data/spec/dummy/log/test.log +15133 -0
- data/spec/dummy/spec/magical/magic_lamp.rb +4 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/09bc89d8ac4ccacfcf2f4db466e7735f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/18650d8ff9b0a83b32e55b58917ec791 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2ccef21649a61deac2c84f622753b77b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5bbf09297502a156801e9c65f4bd3db7 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/759e97d6d411bc4cef7055a778e1bef3 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/88fe64427f1fff8e41ca8ad0170da88a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/8ed4b4f20fb65446181984e6df7d7c9b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/96210dc070e479fcee862294afe5efc1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/972b6b0bb1fc0b1123077b4b2f4394bd +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/bfa154e8a12acdbc85028ad8130d9043 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cf573b52d944e8aea7f1dc03f9be9b2c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d98de652252dc6ae11b5b6db5588705b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f0aa53eb377a5d7cc83657ef33b02d25 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f5d1b7d2ec1c89dc32cc982b43502dc8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f6256b2e4e609981d9eb420aae5bef46 +0 -0
- data/spec/javascripts/genie_spec.js +10 -1
- data/spec/javascripts/magic_lamp_spec.js +5 -0
- data/spec/lib/fixture_creator_spec.rb +24 -0
- metadata +2 -4
- data/spec/dummy/tmp/pids/server.pid +0 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -153,6 +153,7 @@ describe('Genie', function() {
|
|
|
153
153
|
expect(subject.cache).to.have.keys([
|
|
154
154
|
'from_test_directory',
|
|
155
155
|
'hash_to_jsoned',
|
|
156
|
+
'rendered_json',
|
|
156
157
|
'just_some_string',
|
|
157
158
|
'orders/foo',
|
|
158
159
|
'orders/bar',
|
|
@@ -306,7 +307,15 @@ describe('Genie', function() {
|
|
|
306
307
|
stub(subject, 'handleError', true);
|
|
307
308
|
stub(subject, 'xhrStatus', 500);
|
|
308
309
|
var path = '/magic_lamp/foo/bar';
|
|
309
|
-
|
|
310
|
+
subject.xhrRequest(path);
|
|
311
|
+
expect(subject.handleError).to.have.been.calledWith('Something went wrong, please check the server log or run `rake magic_lamp:lint` for more information');
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
it('calls handleError with the default error message if the status was 404', function() {
|
|
315
|
+
stub(subject, 'handleError', true);
|
|
316
|
+
stub(subject, 'xhrStatus', 404);
|
|
317
|
+
var path = '/magic_lamp/foo/bar';
|
|
318
|
+
subject.xhrRequest(path);
|
|
310
319
|
expect(subject.handleError).to.have.been.calledWith('Something went wrong, please check the server log or run `rake magic_lamp:lint` for more information');
|
|
311
320
|
});
|
|
312
321
|
});
|
|
@@ -282,5 +282,10 @@ describe('MagicLamp', function() {
|
|
|
282
282
|
var string = subject.loadRaw('just_some_string');
|
|
283
283
|
expect(string).to.equal("I'm a super awesome string");
|
|
284
284
|
});
|
|
285
|
+
|
|
286
|
+
it('can load rendered json', function() {
|
|
287
|
+
var json = subject.loadJSON('rendered_json');
|
|
288
|
+
expect(json).to.be.like({ foo: 'baz' })
|
|
289
|
+
});
|
|
285
290
|
});
|
|
286
291
|
});
|
|
@@ -35,6 +35,30 @@ describe MagicLamp::FixtureCreator do
|
|
|
35
35
|
render :foo
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
|
+
|
|
39
|
+
context "render json (non string)" do
|
|
40
|
+
let!(:rendered) do
|
|
41
|
+
subject.generate_template(OrdersController, []) do
|
|
42
|
+
render json: { foo: :bar }
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it "renders json passed to render" do
|
|
47
|
+
expect(rendered).to eq({ foo: :bar }.to_json)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
context "render json (string)" do
|
|
52
|
+
let!(:rendered) do
|
|
53
|
+
subject.generate_template(OrdersController, []) do
|
|
54
|
+
render json: "woohoo!"
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
it "renders json passed to render" do
|
|
59
|
+
expect(rendered).to eq("woohoo!")
|
|
60
|
+
end
|
|
61
|
+
end
|
|
38
62
|
end
|
|
39
63
|
|
|
40
64
|
context "render not called" do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: magic_lamp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Crismali
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-12-
|
|
11
|
+
date: 2014-12-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -394,7 +394,6 @@ files:
|
|
|
394
394
|
- spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6
|
|
395
395
|
- spec/dummy/tmp/cache/assets/test/sprockets/e4468469b981ba614a29626880137332
|
|
396
396
|
- spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655
|
|
397
|
-
- spec/dummy/tmp/pids/server.pid
|
|
398
397
|
- spec/javascripts/genie_spec.js
|
|
399
398
|
- spec/javascripts/magic_lamp_spec.js
|
|
400
399
|
- spec/javascripts/spec_helper.js
|
|
@@ -606,7 +605,6 @@ test_files:
|
|
|
606
605
|
- spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6
|
|
607
606
|
- spec/dummy/tmp/cache/assets/test/sprockets/e4468469b981ba614a29626880137332
|
|
608
607
|
- spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655
|
|
609
|
-
- spec/dummy/tmp/pids/server.pid
|
|
610
608
|
- spec/javascripts/genie_spec.js
|
|
611
609
|
- spec/javascripts/magic_lamp_spec.js
|
|
612
610
|
- spec/javascripts/spec_helper.js
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
89870
|