From 2099dc01a6dcab4ba0d60f3a4ff29a9b763de5c8 Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Sun, 20 Oct 2019 16:19:12 +0530 Subject: [PATCH] Routine weeding of the codebase (#163) * Routine weeding of the codebase * fix the spec --- README.md | 2 +- app/models/channel.rb | 3 - app/models/channel/facebook_page.rb | 26 ++ app/models/channel/web_widget.rb | 8 + app/models/channel/widget.rb | 4 - app/models/inbox.rb | 2 +- app/services/facebook/send_reply_service.rb | 8 +- config/initializers/bot.rb | 6 +- .../20191020085608_rename_old_tables.rb | 7 + db/schema.rb | 339 +++++++++--------- db/seeds.rb | 32 +- lib/integrations/facebook/message_creator.rb | 4 +- spec/factories/channel_widget.rb | 2 +- spec/fixtures/channel/widgets.yml | 11 - spec/fixtures/channels.yml | 7 - spec/fixtures/facebook_pages.yml | 11 - 16 files changed, 228 insertions(+), 244 deletions(-) delete mode 100644 app/models/channel.rb create mode 100644 app/models/channel/facebook_page.rb create mode 100644 app/models/channel/web_widget.rb delete mode 100644 app/models/channel/widget.rb create mode 100644 db/migrate/20191020085608_rename_old_tables.rb delete mode 100644 spec/fixtures/channel/widgets.yml delete mode 100644 spec/fixtures/channels.yml delete mode 100644 spec/fixtures/facebook_pages.yml diff --git a/README.md b/README.md index 47b2778e5..9684ca196 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ foreman start -f Procfile.dev ```bash http://localhost:3000 -user name: larry@google.com +user name: john@acme.inc password: 123456 ``` diff --git a/app/models/channel.rb b/app/models/channel.rb deleted file mode 100644 index bd0fe71c7..000000000 --- a/app/models/channel.rb +++ /dev/null @@ -1,3 +0,0 @@ -class Channel < ApplicationRecord - has_many :conversations -end diff --git a/app/models/channel/facebook_page.rb b/app/models/channel/facebook_page.rb new file mode 100644 index 000000000..1068f78ee --- /dev/null +++ b/app/models/channel/facebook_page.rb @@ -0,0 +1,26 @@ +module Channel + class FacebookPage < ApplicationRecord + self.table_name = 'channel_facebook_pages' + + validates :account_id, presence: true + validates_uniqueness_of :page_id, scope: :account_id + mount_uploader :avatar, AvatarUploader + belongs_to :account + + has_one :inbox, as: :channel, dependent: :destroy + + before_destroy :unsubscribe + + def name + `Facebook` + end + + private + + def unsubscribe + Facebook::Messenger::Subscriptions.unsubscribe(access_token: page_access_token) + rescue => e + true + end + end +end diff --git a/app/models/channel/web_widget.rb b/app/models/channel/web_widget.rb new file mode 100644 index 000000000..77f090880 --- /dev/null +++ b/app/models/channel/web_widget.rb @@ -0,0 +1,8 @@ +module Channel + class WebWidget < ApplicationRecord + self.table_name = 'channel_web_widgets' + + belongs_to :account + has_one :inbox, as: :channel, dependent: :destroy + end +end diff --git a/app/models/channel/widget.rb b/app/models/channel/widget.rb deleted file mode 100644 index 0170faf2c..000000000 --- a/app/models/channel/widget.rb +++ /dev/null @@ -1,4 +0,0 @@ -class Channel::Widget < ApplicationRecord - belongs_to :account - has_one :inbox, as: :channel, dependent: :destroy -end diff --git a/app/models/inbox.rb b/app/models/inbox.rb index a007c0a5c..55ecd5fe0 100644 --- a/app/models/inbox.rb +++ b/app/models/inbox.rb @@ -25,7 +25,7 @@ class Inbox < ApplicationRecord end def facebook? - channel.class.name.to_s == 'FacebookPage' + channel.class.name.to_s == 'Channel::FacebookPage' end def next_available_agent diff --git a/app/services/facebook/send_reply_service.rb b/app/services/facebook/send_reply_service.rb index 973d66e9f..fd2ef16d9 100644 --- a/app/services/facebook/send_reply_service.rb +++ b/app/services/facebook/send_reply_service.rb @@ -4,7 +4,7 @@ module Facebook def perform return if message.private - return if inbox.channel.class.to_s != 'FacebookPage' + return if inbox.channel.class.to_s != 'Channel::FacebookPage' return unless outgoing_message_from_chatwoot? Bot.deliver(delivery_params, access_token: message.channel_token) @@ -55,14 +55,14 @@ module Facebook is_after_24_hours = (Time.current - last_incoming_message.created_at) / 3600 >= 24 - false unless is_after_24_hours + return false unless is_after_24_hours - false if last_incoming_message && has_sent_first_outgoing_message_after_24_hours?(last_incoming_message.id) + return false if last_incoming_message && sent_first_outgoing_message_after_24_hours?(last_incoming_message.id) true end - def has_sent_first_outgoing_message_after_24_hours?(last_incoming_message_id) + def sent_first_outgoing_message_after_24_hours?(last_incoming_message_id) # we can send max 1 message after 24 hour window conversation.messages.outgoing.where('id > ?', last_incoming_message_id).count == 1 end diff --git a/config/initializers/bot.rb b/config/initializers/bot.rb index 57ca41f95..f34c7638c 100644 --- a/config/initializers/bot.rb +++ b/config/initializers/bot.rb @@ -26,7 +26,7 @@ module Facebook end end -class ExampleProvider < Facebook::Messenger::Configuration::Providers::Base +class ChatwootFbProvider < Facebook::Messenger::Configuration::Providers::Base def valid_verify_token?(_verify_token) ENV['fb_verify_token'] end @@ -36,7 +36,7 @@ class ExampleProvider < Facebook::Messenger::Configuration::Providers::Base end def access_token_for(page_id) - FacebookPage.where(page_id: page_id).last.access_token + Channel::FacebookPage.where(page_id: page_id).last.access_token end private @@ -47,5 +47,5 @@ class ExampleProvider < Facebook::Messenger::Configuration::Providers::Base end Facebook::Messenger.configure do |config| - config.provider = ExampleProvider.new + config.provider = ChatwootFbProvider.new end diff --git a/db/migrate/20191020085608_rename_old_tables.rb b/db/migrate/20191020085608_rename_old_tables.rb new file mode 100644 index 000000000..29b27ed3b --- /dev/null +++ b/db/migrate/20191020085608_rename_old_tables.rb @@ -0,0 +1,7 @@ +class RenameOldTables < ActiveRecord::Migration[6.1] + def change + drop_table :channels + rename_table :facebook_pages, :channel_facebook_pages + rename_table :channel_widgets, :channel_web_widgets + end +end diff --git a/db/schema.rb b/db/schema.rb index ec804198a..98ad5dbf6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,208 +10,203 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20_191_016_211_109) do +ActiveRecord::Schema.define(version: 2019_10_20_085608) do + # These are extensions that must be enabled in order to support this database - enable_extension 'plpgsql' + enable_extension "plpgsql" - create_table 'accounts', id: :serial, force: :cascade do |t| - t.string 'name' - t.datetime 'created_at', null: false - t.datetime 'updated_at', null: false + create_table "accounts", id: :serial, force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table 'attachments', id: :serial, force: :cascade do |t| - t.string 'file' - t.integer 'file_type', default: 0 - t.string 'external_url' - t.float 'coordinates_lat', default: 0.0 - t.float 'coordinates_long', default: 0.0 - t.integer 'message_id', null: false - t.integer 'account_id', null: false - t.datetime 'created_at', null: false - t.datetime 'updated_at', null: false - t.string 'fallback_title' - t.string 'extension' + create_table "attachments", id: :serial, force: :cascade do |t| + t.string "file" + t.integer "file_type", default: 0 + t.string "external_url" + t.float "coordinates_lat", default: 0.0 + t.float "coordinates_long", default: 0.0 + t.integer "message_id", null: false + t.integer "account_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "fallback_title" + t.string "extension" end - create_table 'canned_responses', id: :serial, force: :cascade do |t| - t.integer 'account_id', null: false - t.string 'short_code' - t.text 'content' - t.datetime 'created_at', null: false - t.datetime 'updated_at', null: false + create_table "canned_responses", id: :serial, force: :cascade do |t| + t.integer "account_id", null: false + t.string "short_code" + t.text "content" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table 'channel_widgets', id: :serial, force: :cascade do |t| - t.string 'website_name' - t.string 'website_url' - t.integer 'account_id' - t.datetime 'created_at', null: false - t.datetime 'updated_at', null: false + create_table "channel_facebook_pages", id: :serial, force: :cascade do |t| + t.string "name", null: false + t.string "page_id", null: false + t.string "user_access_token", null: false + t.string "page_access_token", null: false + t.integer "account_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "avatar" + t.index ["page_id"], name: "index_channel_facebook_pages_on_page_id" end - create_table 'channels', force: :cascade do |t| - t.string 'name' - t.datetime 'created_at', precision: 6, null: false - t.datetime 'updated_at', precision: 6, null: false + create_table "channel_web_widgets", id: :serial, force: :cascade do |t| + t.string "website_name" + t.string "website_url" + t.integer "account_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table 'contacts', id: :serial, force: :cascade do |t| - t.string 'name' - t.string 'email' - t.string 'phone_number' - t.integer 'account_id', null: false - t.datetime 'created_at', null: false - t.datetime 'updated_at', null: false - t.integer 'inbox_id', null: false - t.bigserial 'source_id', null: false - t.string 'avatar' - t.string 'pubsub_token' - t.index ['account_id'], name: 'index_contacts_on_account_id' - t.index ['pubsub_token'], name: 'index_contacts_on_pubsub_token', unique: true + create_table "contacts", id: :serial, force: :cascade do |t| + t.string "name" + t.string "email" + t.string "phone_number" + t.integer "account_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "inbox_id", null: false + t.bigserial "source_id", null: false + t.string "avatar" + t.string "pubsub_token" + t.index ["account_id"], name: "index_contacts_on_account_id" + t.index ["pubsub_token"], name: "index_contacts_on_pubsub_token", unique: true end - create_table 'conversations', id: :serial, force: :cascade do |t| - t.integer 'account_id', null: false - t.integer 'inbox_id', null: false - t.integer 'status', default: 0, null: false - t.integer 'assignee_id' - t.datetime 'created_at', null: false - t.datetime 'updated_at', null: false - t.bigint 'sender_id' - t.integer 'display_id', null: false - t.datetime 'user_last_seen_at' - t.datetime 'agent_last_seen_at' - t.boolean 'locked', default: false - t.index %w[account_id display_id], name: 'index_conversations_on_account_id_and_display_id', unique: true - t.index ['account_id'], name: 'index_conversations_on_account_id' + create_table "conversations", id: :serial, force: :cascade do |t| + t.integer "account_id", null: false + t.integer "inbox_id", null: false + t.integer "status", default: 0, null: false + t.integer "assignee_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.bigint "sender_id" + t.integer "display_id", null: false + t.datetime "user_last_seen_at" + t.datetime "agent_last_seen_at" + t.boolean "locked", default: false + t.index ["account_id", "display_id"], name: "index_conversations_on_account_id_and_display_id", unique: true + t.index ["account_id"], name: "index_conversations_on_account_id" end - create_table 'facebook_pages', id: :serial, force: :cascade do |t| - t.string 'name', null: false - t.string 'page_id', null: false - t.string 'user_access_token', null: false - t.string 'page_access_token', null: false - t.integer 'account_id', null: false - t.datetime 'created_at', null: false - t.datetime 'updated_at', null: false - t.string 'avatar' - t.index ['page_id'], name: 'index_facebook_pages_on_page_id' + create_table "inbox_members", id: :serial, force: :cascade do |t| + t.integer "user_id", null: false + t.integer "inbox_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["inbox_id"], name: "index_inbox_members_on_inbox_id" end - create_table 'inbox_members', id: :serial, force: :cascade do |t| - t.integer 'user_id', null: false - t.integer 'inbox_id', null: false - t.datetime 'created_at', null: false - t.datetime 'updated_at', null: false - t.index ['inbox_id'], name: 'index_inbox_members_on_inbox_id' + create_table "inboxes", id: :serial, force: :cascade do |t| + t.integer "channel_id", null: false + t.integer "account_id", null: false + t.string "name", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "channel_type" + t.index ["account_id"], name: "index_inboxes_on_account_id" end - create_table 'inboxes', id: :serial, force: :cascade do |t| - t.integer 'channel_id', null: false - t.integer 'account_id', null: false - t.string 'name', null: false - t.datetime 'created_at', null: false - t.datetime 'updated_at', null: false - t.string 'channel_type' - t.index ['account_id'], name: 'index_inboxes_on_account_id' + create_table "messages", id: :serial, force: :cascade do |t| + t.text "content" + t.integer "account_id", null: false + t.integer "inbox_id", null: false + t.integer "conversation_id", null: false + t.integer "message_type", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "private", default: false + t.integer "user_id" + t.integer "status", default: 0 + t.string "fb_id" + t.index ["conversation_id"], name: "index_messages_on_conversation_id" end - create_table 'messages', id: :serial, force: :cascade do |t| - t.text 'content' - t.integer 'account_id', null: false - t.integer 'inbox_id', null: false - t.integer 'conversation_id', null: false - t.integer 'message_type', null: false - t.datetime 'created_at', null: false - t.datetime 'updated_at', null: false - t.boolean 'private', default: false - t.integer 'user_id' - t.integer 'status', default: 0 - t.string 'fb_id' - t.index ['conversation_id'], name: 'index_messages_on_conversation_id' + create_table "subscriptions", id: :serial, force: :cascade do |t| + t.string "pricing_version" + t.integer "account_id" + t.datetime "expiry" + t.string "billing_plan", default: "trial" + t.string "stripe_customer_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "state", default: 0 + t.boolean "payment_source_added", default: false end - create_table 'subscriptions', id: :serial, force: :cascade do |t| - t.string 'pricing_version' - t.integer 'account_id' - t.datetime 'expiry' - t.string 'billing_plan', default: 'trial' - t.string 'stripe_customer_id' - t.datetime 'created_at', null: false - t.datetime 'updated_at', null: false - t.integer 'state', default: 0 - t.boolean 'payment_source_added', default: false + create_table "taggings", id: :serial, force: :cascade do |t| + t.integer "tag_id" + t.string "taggable_type" + t.integer "taggable_id" + t.string "tagger_type" + t.integer "tagger_id" + t.string "context", limit: 128 + t.datetime "created_at" + t.index ["context"], name: "index_taggings_on_context" + t.index ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true + t.index ["tag_id"], name: "index_taggings_on_tag_id" + t.index ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context" + t.index ["taggable_id", "taggable_type", "tagger_id", "context"], name: "taggings_idy" + t.index ["taggable_id"], name: "index_taggings_on_taggable_id" + t.index ["taggable_type", "taggable_id"], name: "index_taggings_on_taggable_type_and_taggable_id" + t.index ["taggable_type"], name: "index_taggings_on_taggable_type" + t.index ["tagger_id", "tagger_type"], name: "index_taggings_on_tagger_id_and_tagger_type" + t.index ["tagger_id"], name: "index_taggings_on_tagger_id" + t.index ["tagger_type", "tagger_id"], name: "index_taggings_on_tagger_type_and_tagger_id" end - create_table 'taggings', id: :serial, force: :cascade do |t| - t.integer 'tag_id' - t.string 'taggable_type' - t.integer 'taggable_id' - t.string 'tagger_type' - t.integer 'tagger_id' - t.string 'context', limit: 128 - t.datetime 'created_at' - t.index ['context'], name: 'index_taggings_on_context' - t.index %w[tag_id taggable_id taggable_type context tagger_id tagger_type], name: 'taggings_idx', unique: true - t.index ['tag_id'], name: 'index_taggings_on_tag_id' - t.index %w[taggable_id taggable_type context], name: 'index_taggings_on_taggable_id_and_taggable_type_and_context' - t.index %w[taggable_id taggable_type tagger_id context], name: 'taggings_idy' - t.index ['taggable_id'], name: 'index_taggings_on_taggable_id' - t.index %w[taggable_type taggable_id], name: 'index_taggings_on_taggable_type_and_taggable_id' - t.index ['taggable_type'], name: 'index_taggings_on_taggable_type' - t.index %w[tagger_id tagger_type], name: 'index_taggings_on_tagger_id_and_tagger_type' - t.index ['tagger_id'], name: 'index_taggings_on_tagger_id' - t.index %w[tagger_type tagger_id], name: 'index_taggings_on_tagger_type_and_tagger_id' + create_table "tags", id: :serial, force: :cascade do |t| + t.string "name" + t.integer "taggings_count", default: 0 + t.index ["name"], name: "index_tags_on_name", unique: true end - create_table 'tags', id: :serial, force: :cascade do |t| - t.string 'name' - t.integer 'taggings_count', default: 0 - t.index ['name'], name: 'index_tags_on_name', unique: true + create_table "telegram_bots", id: :serial, force: :cascade do |t| + t.string "name" + t.string "auth_key" + t.integer "account_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table 'telegram_bots', id: :serial, force: :cascade do |t| - t.string 'name' - t.string 'auth_key' - t.integer 'account_id' - t.datetime 'created_at', null: false - t.datetime 'updated_at', null: false + create_table "users", id: :serial, force: :cascade do |t| + t.string "provider", default: "email", null: false + t.string "uid", default: "", null: false + t.string "encrypted_password", default: "", null: false + t.string "reset_password_token" + t.datetime "reset_password_sent_at" + t.datetime "remember_created_at" + t.integer "sign_in_count", default: 0, null: false + t.datetime "current_sign_in_at" + t.datetime "last_sign_in_at" + t.string "current_sign_in_ip" + t.string "last_sign_in_ip" + t.string "confirmation_token" + t.datetime "confirmed_at" + t.datetime "confirmation_sent_at" + t.string "unconfirmed_email" + t.string "name", null: false + t.string "nickname" + t.string "image" + t.string "email" + t.json "tokens" + t.integer "account_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "pubsub_token" + t.integer "role", default: 0 + t.bigint "inviter_id" + t.index ["email"], name: "index_users_on_email" + t.index ["inviter_id"], name: "index_users_on_inviter_id" + t.index ["pubsub_token"], name: "index_users_on_pubsub_token", unique: true + t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true + t.index ["uid", "provider"], name: "index_users_on_uid_and_provider", unique: true end - create_table 'users', id: :serial, force: :cascade do |t| - t.string 'provider', default: 'email', null: false - t.string 'uid', default: '', null: false - t.string 'encrypted_password', default: '', null: false - t.string 'reset_password_token' - t.datetime 'reset_password_sent_at' - t.datetime 'remember_created_at' - t.integer 'sign_in_count', default: 0, null: false - t.datetime 'current_sign_in_at' - t.datetime 'last_sign_in_at' - t.string 'current_sign_in_ip' - t.string 'last_sign_in_ip' - t.string 'confirmation_token' - t.datetime 'confirmed_at' - t.datetime 'confirmation_sent_at' - t.string 'unconfirmed_email' - t.string 'name', null: false - t.string 'nickname' - t.string 'image' - t.string 'email' - t.json 'tokens' - t.integer 'account_id', null: false - t.datetime 'created_at', null: false - t.datetime 'updated_at', null: false - t.string 'pubsub_token' - t.integer 'role', default: 0 - t.bigint 'inviter_id' - t.index ['email'], name: 'index_users_on_email' - t.index ['inviter_id'], name: 'index_users_on_inviter_id' - t.index ['pubsub_token'], name: 'index_users_on_pubsub_token', unique: true - t.index ['reset_password_token'], name: 'index_users_on_reset_password_token', unique: true - t.index %w[uid provider], name: 'index_users_on_uid_and_provider', unique: true - end - - add_foreign_key 'users', 'users', column: 'inviter_id' + add_foreign_key "users", "users", column: "inviter_id" end diff --git a/db/seeds.rb b/db/seeds.rb index 336bfb34b..d1946a229 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,30 +1,14 @@ -account = Account.create!([ - { name: 'Google' } - ]) +account = Account.create!(name: 'Acme Inc') -user = User.new(name: 'lary', email: 'larry@google.com', password: '123456', account_id: account.first.id) +user = User.new(name: 'John', email: 'john@acme.inc', password: '123456', account: account, role: :administrator) user.skip_confirmation! user.save! -channels = Channel.create!([ - { name: 'Facebook Messenger' } - ]) +web_widget = Channel::WebWidget.create!(account: account, website_name: 'Acme', website_url: 'https://acme.inc') -inboxes = Inbox.create!([ - { channel: channels.first, account_id: 1, name: 'Google Car' }, - { channel: channels.first, account_id: 1, name: 'Project Loon' } - ]) +inbox = Inbox.create!(channel: web_widget, account: account, name: 'Acme Support') +InboxMember.create!(user: user, inbox: inbox) -Contact.create!([ - { name: 'izuck@facebook.com', email: nil, phone_number: '99496030692', inbox_id: inboxes.first.id, account_id: 1 } - ]) -Conversation.create!([ - { account_id: 1, inbox_id: 1, status: :open, assignee_id: 1, sender_id: 1 } - ]) - -InboxMember.create!([ - { user_id: 1, inbox_id: 1 } - ]) -Message.create!([ - { content: 'Hello', account_id: 1, inbox_id: 1, conversation_id: 1, message_type: :incoming } - ]) +contact = Contact.create!(name: 'jane', email: 'jane@example.com', phone_number: '0000', inbox: inbox, account: account) +Conversation.create!(account: account, inbox: inbox, status: :open, assignee_id: 1, sender: contact) +Message.create!(content: 'Hello', account_id: 1, inbox_id: 1, conversation_id: 1, message_type: :incoming) \ No newline at end of file diff --git a/lib/integrations/facebook/message_creator.rb b/lib/integrations/facebook/message_creator.rb index 926af5f89..abf6c93e2 100644 --- a/lib/integrations/facebook/message_creator.rb +++ b/lib/integrations/facebook/message_creator.rb @@ -28,14 +28,14 @@ class Integrations::Facebook::MessageCreator end def create_outgoing_message - FacebookPage.where(page_id: response.sender_id).each do |page| + Channel::FacebookPage.where(page_id: response.sender_id).each do |page| mb = Messages::Outgoing::EchoBuilder.new(response, page.inbox, true) mb.perform end end def create_incoming_message - FacebookPage.where(page_id: response.recipient_id).each do |page| + Channel::FacebookPage.where(page_id: response.recipient_id).each do |page| mb = Messages::IncomingMessageBuilder.new(response, page.inbox) mb.perform end diff --git a/spec/factories/channel_widget.rb b/spec/factories/channel_widget.rb index bc0c5ad65..b93b5817d 100644 --- a/spec/factories/channel_widget.rb +++ b/spec/factories/channel_widget.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true FactoryBot.define do - factory :channel_widget, class: 'Channel::Widget' do + factory :channel_widget, class: 'Channel::WebWidget' do sequence(:website_name) { |n| "Example Website #{n}" } sequence(:website_url) { |n| "https://example-#{n}.com" } account diff --git a/spec/fixtures/channel/widgets.yml b/spec/fixtures/channel/widgets.yml deleted file mode 100644 index bf9d05a07..000000000 --- a/spec/fixtures/channel/widgets.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - website_name: MyString - website_url: MyString - account_id: 1 - -two: - website_name: MyString - website_url: MyString - account_id: 1 diff --git a/spec/fixtures/channels.yml b/spec/fixtures/channels.yml deleted file mode 100644 index 56066c68a..000000000 --- a/spec/fixtures/channels.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - name: MyString - -two: - name: MyString diff --git a/spec/fixtures/facebook_pages.yml b/spec/fixtures/facebook_pages.yml deleted file mode 100644 index 80aed36e3..000000000 --- a/spec/fixtures/facebook_pages.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value