Skip to content

Commit

Permalink
Give all spec names the correct tense
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Yurek committed Mar 11, 2014
1 parent 244bb20 commit 71727f4
Show file tree
Hide file tree
Showing 46 changed files with 720 additions and 719 deletions.
14 changes: 7 additions & 7 deletions spec/paperclip/attachment_processing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
rebuild_class
end

it 'process attachments given a valid assignment' do
it 'processes attachments given a valid assignment' do
file = File.new(fixture_file("5k.png"))
Dummy.validates_attachment_content_type :avatar, content_type: "image/png"
instance = Dummy.new
Expand All @@ -17,7 +17,7 @@
attachment.assign(file)
end

it 'not process attachments given an invalid assignment with :not' do
it 'does not process attachments given an invalid assignment with :not' do
file = File.new(fixture_file("5k.png"))
Dummy.validates_attachment_content_type :avatar, not: "image/png"
instance = Dummy.new
Expand All @@ -27,7 +27,7 @@
attachment.assign(file)
end

it 'not process attachments given an invalid assignment with :content_type' do
it 'does not process attachments given an invalid assignment with :content_type' do
file = File.new(fixture_file("5k.png"))
Dummy.validates_attachment_content_type :avatar, content_type: "image/tiff"
instance = Dummy.new
Expand All @@ -37,7 +37,7 @@
attachment.assign(file)
end

it 'when validation :if clause returns false, allow what would be an invalid assignment' do
it 'allows what would be an invalid assignment when validation :if clause returns false' do
invalid_assignment = File.new(fixture_file("5k.png"))
Dummy.validates_attachment_content_type :avatar, content_type: "image/tiff", if: lambda{false}
instance = Dummy.new
Expand All @@ -49,7 +49,7 @@
end

context 'using validates_attachment' do
it 'process attachments given a valid assignment' do
it 'processes attachments given a valid assignment' do
file = File.new(fixture_file("5k.png"))
Dummy.validates_attachment :avatar, content_type: {content_type: "image/png"}
instance = Dummy.new
Expand All @@ -59,7 +59,7 @@
attachment.assign(file)
end

it 'not process attachments given an invalid assignment with :not' do
it 'does not process attachments given an invalid assignment with :not' do
file = File.new(fixture_file("5k.png"))
Dummy.validates_attachment :avatar, content_type: {not: "image/png"}
instance = Dummy.new
Expand All @@ -69,7 +69,7 @@
attachment.assign(file)
end

it 'not process attachments given an invalid assignment with :content_type' do
it 'does not process attachments given an invalid assignment with :content_type' do
file = File.new(fixture_file("5k.png"))
Dummy.validates_attachment :avatar, content_type: {content_type: "image/tiff"}
instance = Dummy.new
Expand Down
14 changes: 7 additions & 7 deletions spec/paperclip/attachment_registry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
end

context '.names_for' do
it 'include attachment names for the given class' do
it 'includes attachment names for the given class' do
foo = Class.new
Paperclip::AttachmentRegistry.register(foo, :avatar, {})

assert_equal [:avatar], Paperclip::AttachmentRegistry.names_for(foo)
end

it 'not include attachment names for other classes' do
it 'does not include attachment names for other classes' do
foo = Class.new
bar = Class.new
Paperclip::AttachmentRegistry.register(foo, :avatar, {})
Expand All @@ -22,13 +22,13 @@
assert_equal [:lover], Paperclip::AttachmentRegistry.names_for(bar)
end

it 'produce the empty array for a missing key' do
it 'produces the empty array for a missing key' do
assert_empty Paperclip::AttachmentRegistry.names_for(Class.new)
end
end

context '.each_definition' do
it 'call the block with the class, attachment name, and options' do
it 'calls the block with the class, attachment name, and options' do
foo = Class.new
expected_accumulations = [
[foo, :avatar, { yo: 'greeting' }],
Expand All @@ -48,7 +48,7 @@
end

context '.definitions_for' do
it 'produce the attachment name and options' do
it 'produces the attachment name and options' do
expected_definitions = {
avatar: { yo: 'greeting' },
greeter: { ciao: 'greeting' }
Expand All @@ -62,7 +62,7 @@
assert_equal expected_definitions, definitions
end

it "produce defintions for subclasses" do
it "produces defintions for subclasses" do
expected_definitions = { avatar: { yo: 'greeting' } }
Foo = Class.new
Bar = Class.new(Foo)
Expand All @@ -75,7 +75,7 @@
end

context '.clear' do
it 'remove all of the existing attachment definitions' do
it 'removes all of the existing attachment definitions' do
foo = Class.new
Paperclip::AttachmentRegistry.register(foo, :greeter, { ciao: 'greeting' })

Expand Down
Loading

0 comments on commit 71727f4

Please sign in to comment.