rspec_more 0.3 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +1 -0
- data/lib/rspec_more/active_record.rb +9 -0
- data/rspec_more.gemspec +2 -2
- metadata +2 -2
data/CHANGELOG
CHANGED
@@ -7,6 +7,15 @@ module RspecMore
|
|
7
7
|
subject.should have(1).error_on(field.to_sym)
|
8
8
|
end
|
9
9
|
end
|
10
|
+
def uniqueness_on(field)
|
11
|
+
it "requires #{field} to be unique" do
|
12
|
+
subject.save!
|
13
|
+
object_name = self.send(:described_class).to_s.demodulize.underscore.to_sym
|
14
|
+
another = Factory.build object_name, field => subject.send(field)
|
15
|
+
another.should_not be_valid
|
16
|
+
another.should have(1).error_on(field.to_sym)
|
17
|
+
end
|
18
|
+
end
|
10
19
|
end
|
11
20
|
end
|
12
21
|
|
data/rspec_more.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{rspec_more}
|
5
|
-
s.version = "0.3"
|
5
|
+
s.version = "0.3.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = [%q{Yi Wen}]
|
9
|
-
s.date = %q{2011-06-
|
9
|
+
s.date = %q{2011-06-24}
|
10
10
|
s.description = %q{A Rspec extension for more macros and matchers, etc.}
|
11
11
|
s.email = %q{hayafirst@gmail.com}
|
12
12
|
s.extra_rdoc_files = [%q{CHANGELOG}, %q{README.md}, %q{lib/rspec_more.rb}, %q{lib/rspec_more/active_record.rb}, %q{lib/rspec_more/data_mapper.rb}]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_more
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-06-
|
12
|
+
date: 2011-06-24 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: A Rspec extension for more macros and matchers, etc.
|
15
15
|
email: hayafirst@gmail.com
|