Skip to content

Commit

Permalink
updated to new version of FFaker
Browse files Browse the repository at this point in the history
  • Loading branch information
drobin03 committed Apr 20, 2015
1 parent fea263b commit a9a7aca
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions spec/factories/smithy_content_block_templates.rb
Expand Up @@ -3,7 +3,7 @@
FactoryGirl.define do
factory :content_block_template, :class => 'Smithy::ContentBlockTemplate' do
content_block
name { Faker::Lorem.words(5).join(' ') }
content { Faker::Lorem.paragraph }
name { FFaker::Lorem.words(5).join(' ') }
content { FFaker::Lorem.paragraph }
end
end
2 changes: 1 addition & 1 deletion spec/factories/smithy_content_blocks.rb
Expand Up @@ -2,6 +2,6 @@

FactoryGirl.define do
factory :content_block, :class => 'Smithy::ContentBlock' do
name { Faker::Lorem.words(5).join(' ') }
name { FFaker::Lorem.words(5).join(' ') }
end
end
2 changes: 1 addition & 1 deletion spec/factories/smithy_contents.rb
Expand Up @@ -2,6 +2,6 @@

FactoryGirl.define do
factory :content, :class => 'Smithy::Content' do
content { Faker::Lorem.paragraph }
content { FFaker::Lorem.paragraph }
end
end
4 changes: 2 additions & 2 deletions spec/factories/smithy_images.rb
Expand Up @@ -3,7 +3,7 @@
FactoryGirl.define do
factory :image, :class => 'Smithy::Image' do
asset
alternate_text { Faker::Lorem.words(5).join(' ') }
content { Faker::Lorem.sentence }
alternate_text { FFaker::Lorem.words(5).join(' ') }
content { FFaker::Lorem.sentence }
end
end
2 changes: 1 addition & 1 deletion spec/factories/smithy_page_contents.rb
Expand Up @@ -4,7 +4,7 @@
factory :page_content, :class => 'Smithy::PageContent' do
page
container 'main_content'
label { Faker::Lorem.words(2).join(' ') }
label { FFaker::Lorem.words(2).join(' ') }
association :content_block, factory: :content
trait :publishable do
publishable true
Expand Down
6 changes: 3 additions & 3 deletions spec/factories/smithy_pages.rb
Expand Up @@ -3,9 +3,9 @@
FactoryGirl.define do
factory :page, :class => 'Smithy::Page' do
template
title { Faker::Lorem.words(2).join(' ') }
description { Faker::Lorem.sentence }
keywords { Faker::Lorem.words(10).join(' ') }
title { FFaker::Lorem.words(2).join(' ') }
description { FFaker::Lorem.sentence }
keywords { FFaker::Lorem.words(10).join(' ') }
published_at 1.day.ago
end
end
4 changes: 2 additions & 2 deletions spec/factories/smithy_settings.rb
Expand Up @@ -2,7 +2,7 @@

FactoryGirl.define do
factory :setting, :class => 'Smithy::Setting' do
name { Faker::Lorem.words(5).join('_') }
value { Faker::Lorem.words(5).join('_') }
name { FFaker::Lorem.words(5).join('_') }
value { FFaker::Lorem.words(5).join('_') }
end
end
2 changes: 1 addition & 1 deletion spec/factories/smithy_template_containers.rb
Expand Up @@ -2,7 +2,7 @@

FactoryGirl.define do
factory :template_container, :class => 'Smithy::TemplateContainer' do
name { Faker::Lorem.words(5).join(' ') }
name { FFaker::Lorem.words(5).join(' ') }
template
end
end
4 changes: 2 additions & 2 deletions spec/factories/smithy_templates.rb
Expand Up @@ -2,8 +2,8 @@

FactoryGirl.define do
factory :template, :class => 'Smithy::Template' do
name { Faker::Lorem.words(5).join(' ') }
content { Faker::Lorem.paragraph }
name { FFaker::Lorem.words(5).join(' ') }
content { FFaker::Lorem.paragraph }
template_type 'template'
end
end
8 changes: 4 additions & 4 deletions spec/lib/smithy/formatter_spec.rb
@@ -1,15 +1,15 @@
require 'rails_helper'

RSpec.describe Smithy::Formatter do
subject(:content) { Faker::Lorem.sentence }
subject(:content) { FFaker::Lorem.sentence }
subject(:formatter) { formatter = Smithy::Formatter.new(content) }

describe "#render" do
subject(:render) { formatter.render.gsub(/\n/, '') }
it { is_expected.to eql "<p>#{content}</p>" }
%w( p div ul ol li blockquote pre h1 h2 h3 h4 h5 h6 object ).each do |tag|
context "block-level tags" do
subject(:content) { "<#{tag}>#{Faker::Lorem.sentence}</#{tag}>"}
subject(:content) { "<#{tag}>#{FFaker::Lorem.sentence}</#{tag}>"}
it "(#{tag}) shouldn't be removed" do
expect(render).to eql content
end
Expand All @@ -25,15 +25,15 @@
end
%w( a span sub sup strong em abbr code del small big ).each do |tag|
context "span-level tags" do
subject(:content) { "<#{tag}>#{Faker::Lorem.sentence}</#{tag}>"}
subject(:content) { "<#{tag}>#{FFaker::Lorem.sentence}</#{tag}>"}
it "(#{tag}) shouldn't be removed" do
expect(render).to eql "<p>#{content}</p>"
end
end
end
%w( br img ).each do |tag|
context "inline tags" do
subject(:content) { "#{Faker::Lorem.sentence} <#{tag}>"}
subject(:content) { "#{FFaker::Lorem.sentence} <#{tag}>"}
it "(#{tag}) shouldn't be removed" do
expect(render).to eql "<p>#{content}</p>"
end
Expand Down

0 comments on commit a9a7aca

Please sign in to comment.