Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Commit

Permalink
Kill fixtures!
Browse files Browse the repository at this point in the history
  • Loading branch information
seven1m committed May 4, 2014
1 parent 396ac90 commit 822c1cb
Show file tree
Hide file tree
Showing 44 changed files with 789 additions and 1,423 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ GEM
method_source (0.8.2)
mime-types (1.25.1)
mini_portile (0.5.3)
multi_json (1.9.2)
multi_json (1.9.3)
mysql2 (0.3.15)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def is_tour_page?
end

def feature_enabled?
unless (@page and @page.system? and !@page.home?) or \
unless @page and @page.system? and !@page.home?
redirect_to stream_path
false
end
Expand Down
13 changes: 0 additions & 13 deletions config/initializers/_settings.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
if Rails.env.test? and ActiveRecord::Base.connected?
%w(settings sites).each do |file|
model = eval(file.singularize.classify)
next unless model.table_exists?
path = Rails.root.join("test/fixtures/#{file}.yml")
if File.exist?(path)
YAML::load(File.open(path)).each do |fixture, values|
model.create(values)
end
end
end
end

SETTINGS = {}

Setting.update_all if Setting.table_exists?
2 changes: 1 addition & 1 deletion test/factories/pages.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FactoryGirl.define do
factory :page do
sequence(:slug) { |n| "page_#{n}" }
sequence(:path) { |n| "page_#{n}" }
title 'Page'
body 'this is the page body'
system true
end
end
8 changes: 8 additions & 0 deletions test/factories/people.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
full_access true
family

trait :super_admin do
admin { Admin.create!(super_admin: true) }
end

trait :admin_edit_profiles do
admin { Admin.create!(edit_profiles: true) }
end
Expand All @@ -20,6 +24,10 @@
admin { Admin.create!(manage_updates: true) }
end

trait :admin_manage_groups do
admin { Admin.create!(manage_groups: true) }
end

trait :with_business do
business_category 'Home Improvement'
business_name 'ABC Home Improvement'
Expand Down
4 changes: 0 additions & 4 deletions test/fixtures/admins.yml

This file was deleted.

45 changes: 0 additions & 45 deletions test/fixtures/families.yml

This file was deleted.

24 changes: 0 additions & 24 deletions test/fixtures/friendships.yml

This file was deleted.

38 changes: 0 additions & 38 deletions test/fixtures/groups.yml

This file was deleted.

30 changes: 0 additions & 30 deletions test/fixtures/memberships.yml

This file was deleted.

4 changes: 2 additions & 2 deletions test/fixtures/multipart.email
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
Thread-Topic: multipart test
Thread-Index: AcifO8WeOLjg2B43TDKkxKKI+foZlw==
From: "Peter Jones" <peter@foobar.com>
To: "College Group" <college@example.com>
From: FROM_ADDRESS
To: TO_ADDRESS

This is a multi-part message in MIME format.

Expand Down
14 changes: 0 additions & 14 deletions test/fixtures/news_items.yml

This file was deleted.

32 changes: 0 additions & 32 deletions test/fixtures/pages.yml

This file was deleted.

Loading

0 comments on commit 822c1cb

Please sign in to comment.