drafter 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/drafter.gemspec +1 -1
- data/lib/drafter/apply.rb +4 -2
- data/test/drafter/test_apply.rb +24 -12
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/drafter.gemspec
CHANGED
data/lib/drafter/apply.rb
CHANGED
data/test/drafter/test_apply.rb
CHANGED
@@ -12,23 +12,35 @@ class TestCreation < Minitest::Unit::TestCase
|
|
12
12
|
describe "to an existing article" do
|
13
13
|
before do
|
14
14
|
@article.save!
|
15
|
-
@article.text = "changed"
|
16
|
-
@article.upload = file_upload("bar.txt")
|
17
|
-
@article.save_draft
|
18
|
-
@article.reload
|
19
|
-
@article.apply_draft
|
20
15
|
end
|
21
16
|
|
22
|
-
|
23
|
-
|
17
|
+
describe "when there's no draft" do
|
18
|
+
it "should just return the article" do
|
19
|
+
@article.apply_draft
|
20
|
+
assert @article
|
21
|
+
end
|
24
22
|
end
|
25
23
|
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
describe "with a draft" do
|
25
|
+
before do
|
26
|
+
@article.text = "changed"
|
27
|
+
@article.upload = file_upload("bar.txt")
|
28
|
+
@article.save_draft
|
29
|
+
@article.reload
|
30
|
+
@article.apply_draft
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should change the article without saving it" do
|
34
|
+
assert @article.changed?
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should apply the text change" do
|
38
|
+
assert_equal("changed", @article.text)
|
39
|
+
end
|
29
40
|
|
30
|
-
|
31
|
-
|
41
|
+
it "should restore the draft upload" do
|
42
|
+
assert_equal("bar.txt", @article.upload.filename)
|
43
|
+
end
|
32
44
|
end
|
33
45
|
end
|
34
46
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drafter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -223,7 +223,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
223
223
|
version: '0'
|
224
224
|
segments:
|
225
225
|
- 0
|
226
|
-
hash:
|
226
|
+
hash: 1415611400334149220
|
227
227
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
228
228
|
none: false
|
229
229
|
requirements:
|