From 1d621019d7bf74b65898e009aef31766c7e7572b Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 16 Sep 2017 22:40:16 -0400 Subject: Created a bunch of models --- Gemfile.lock | 123 +++++++++++++++++++++ app/models/pokeviewer/move.rb | 10 ++ app/models/pokeviewer/pokemon.rb | 50 +++++++++ app/models/pokeviewer/revision.rb | 72 ++++++++++++ app/models/pokeviewer/revision_move.rb | 19 ++++ app/models/pokeviewer/species.rb | 7 ++ app/models/pokeviewer/trainer.rb | 17 +++ config/initializers/inflection.rb | 3 + .../20170916225306_create_pokeviewer_trainers.rb | 13 +++ .../20170916232015_create_pokeviewer_species.rb | 11 ++ .../20170916234251_create_pokeviewer_pokemon.rb | 31 ++++++ .../20170917002857_create_pokeviewer_revisions.rb | 31 ++++++ .../20170917011102_create_pokeviewer_moves.rb | 12 ++ ...70917011258_create_pokeviewer_revision_moves.rb | 20 ++++ lib/pokeviewer/engine.rb | 3 + pokeviewer.gemspec | 8 +- test/dummy/db/schema.rb | 99 +++++++++++++++++ test/fixtures/pokeviewer/moves.yml | 9 ++ test/fixtures/pokeviewer/pokemon.yml | 31 ++++++ test/fixtures/pokeviewer/revision_moves.yml | 13 +++ test/fixtures/pokeviewer/revisions.yml | 55 +++++++++ test/fixtures/pokeviewer/species.yml | 9 ++ test/fixtures/pokeviewer/trainers.yml | 11 ++ test/models/pokeviewer/move_test.rb | 9 ++ test/models/pokeviewer/pokemon_test.rb | 9 ++ test/models/pokeviewer/revision_move_test.rb | 9 ++ test/models/pokeviewer/revision_test.rb | 9 ++ test/models/pokeviewer/species_test.rb | 9 ++ test/models/pokeviewer/trainer_test.rb | 9 ++ 29 files changed, 708 insertions(+), 3 deletions(-) create mode 100644 Gemfile.lock create mode 100644 app/models/pokeviewer/move.rb create mode 100644 app/models/pokeviewer/pokemon.rb create mode 100644 app/models/pokeviewer/revision.rb create mode 100644 app/models/pokeviewer/revision_move.rb create mode 100644 app/models/pokeviewer/species.rb create mode 100644 app/models/pokeviewer/trainer.rb create mode 100644 config/initializers/inflection.rb create mode 100644 db/migrate/20170916225306_create_pokeviewer_trainers.rb create mode 100644 db/migrate/20170916232015_create_pokeviewer_species.rb create mode 100644 db/migrate/20170916234251_create_pokeviewer_pokemon.rb create mode 100644 db/migrate/20170917002857_create_pokeviewer_revisions.rb create mode 100644 db/migrate/20170917011102_create_pokeviewer_moves.rb create mode 100644 db/migrate/20170917011258_create_pokeviewer_revision_moves.rb create mode 100644 test/dummy/db/schema.rb create mode 100644 test/fixtures/pokeviewer/moves.yml create mode 100644 test/fixtures/pokeviewer/pokemon.yml create mode 100644 test/fixtures/pokeviewer/revision_moves.yml create mode 100644 test/fixtures/pokeviewer/revisions.yml create mode 100644 test/fixtures/pokeviewer/species.yml create mode 100644 test/fixtures/pokeviewer/trainers.yml create mode 100644 test/models/pokeviewer/move_test.rb create mode 100644 test/models/pokeviewer/pokemon_test.rb create mode 100644 test/models/pokeviewer/revision_move_test.rb create mode 100644 test/models/pokeviewer/revision_test.rb create mode 100644 test/models/pokeviewer/species_test.rb create mode 100644 test/models/pokeviewer/trainer_test.rb diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..30e3155 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,123 @@ +PATH + remote: . + specs: + pokeviewer (0.1.0) + enumerize + rails (~> 5.1.4) + sequential + +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.1.4) + actionpack (= 5.1.4) + nio4r (~> 2.0) + websocket-driver (~> 0.6.1) + actionmailer (5.1.4) + actionpack (= 5.1.4) + actionview (= 5.1.4) + activejob (= 5.1.4) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.1.4) + actionview (= 5.1.4) + activesupport (= 5.1.4) + rack (~> 2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.1.4) + activesupport (= 5.1.4) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.1.4) + activesupport (= 5.1.4) + globalid (>= 0.3.6) + activemodel (5.1.4) + activesupport (= 5.1.4) + activerecord (5.1.4) + activemodel (= 5.1.4) + activesupport (= 5.1.4) + arel (~> 8.0) + activesupport (5.1.4) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (~> 0.7) + minitest (~> 5.1) + tzinfo (~> 1.1) + arel (8.0.0) + builder (3.2.3) + concurrent-ruby (1.0.5) + enumerize (2.1.2) + activesupport (>= 3.2) + erubi (1.6.1) + globalid (0.4.0) + activesupport (>= 4.2.0) + i18n (0.8.6) + loofah (2.0.3) + nokogiri (>= 1.5.9) + mail (2.6.6) + mime-types (>= 1.16, < 4) + method_source (0.8.2) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mini_portile2 (2.2.0) + minitest (5.10.3) + nio4r (2.1.0) + nokogiri (1.8.0) + mini_portile2 (~> 2.2.0) + rack (2.0.3) + rack-test (0.7.0) + rack (>= 1.0, < 3) + rails (5.1.4) + actioncable (= 5.1.4) + actionmailer (= 5.1.4) + actionpack (= 5.1.4) + actionview (= 5.1.4) + activejob (= 5.1.4) + activemodel (= 5.1.4) + activerecord (= 5.1.4) + activesupport (= 5.1.4) + bundler (>= 1.3.0) + railties (= 5.1.4) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + railties (5.1.4) + actionpack (= 5.1.4) + activesupport (= 5.1.4) + method_source + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (12.1.0) + sequential (0.2) + sprockets (3.7.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.3.13) + thor (0.20.0) + thread_safe (0.3.6) + tzinfo (1.2.3) + thread_safe (~> 0.1) + websocket-driver (0.6.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.2) + +PLATFORMS + ruby + +DEPENDENCIES + pokeviewer! + sqlite3 + +BUNDLED WITH + 1.15.1 diff --git a/app/models/pokeviewer/move.rb b/app/models/pokeviewer/move.rb new file mode 100644 index 0000000..337ac11 --- /dev/null +++ b/app/models/pokeviewer/move.rb @@ -0,0 +1,10 @@ +module Pokeviewer + class Move < ApplicationRecord + has_many :revision_moves + has_many :revisions, through: :revision_moves + + validates :name, presence: true, uniqueness: true + validates :pp, presence: true, + numericality: { greater_than_or_equal_to: 1, only_integer: true } + end +end diff --git a/app/models/pokeviewer/pokemon.rb b/app/models/pokeviewer/pokemon.rb new file mode 100644 index 0000000..114e9dd --- /dev/null +++ b/app/models/pokeviewer/pokemon.rb @@ -0,0 +1,50 @@ +module Pokeviewer + class Pokemon < ApplicationRecord + extend Enumerize + + belongs_to :species + belongs_to :trainer, optional: true + has_many :revisions, dependent: :destroy + + validate :uuid_is_constant, on: :update + before_create :set_uuid + + validates :ot_name, presence: true + + validates :ot_number, presence: true, + numericality: { greater_than_or_equal_to: 0, only_integer: true } + + validates :met_level, presence: true, + numericality: { greater_than_or_equal_to: 1, only_integer: true } + + validates :met_type, presence: true + enumerize :met_type, in: [:normal, :hatched, :npc_trade, :fateful_encounter] + + validates :gender, presence: true + enumerize :gender, in: [:genderless, :female, :male] + + validates :nature, presence: true + enumerize :nature, in: [:hardy, :lonely, :brave, :adamant, :naughty, :bold, + :docile, :relaxed, :impish, :lax, :timid, :hasty, :serious, :jolly, + :naive, :modest, :mild, :quiet, :bashful, :rash, :calm, :gentle, :sassy, + :careful, :quirky] + + enumerize :unown_letter, in: [:a, :b, :c, :d, :e, :f, :g, :h, :i, :j, :k, + :l, :m, :n, :o, :p, :q, :r, :s, :t, :u, :v, :w, :x, :y, :z, + :question_mark, :exclamation_mark] + + def to_param + uuid + end + + private + + def set_uuid + self.uuid = SecureRandom.uuid + end + + def uuid_is_constant + errors.add(:uuid, "can't be changed") if self.uuid_changed? + end + end +end diff --git a/app/models/pokeviewer/revision.rb b/app/models/pokeviewer/revision.rb new file mode 100644 index 0000000..a8f8ab2 --- /dev/null +++ b/app/models/pokeviewer/revision.rb @@ -0,0 +1,72 @@ +module Pokeviewer + class Revision < ApplicationRecord + belongs_to :pokemon + acts_as_sequenced scope: :pokemon_id + + has_many :revision_moves, -> { order "number ASC" } + has_many :moves, through: :revision_moves + + validates :moves, presence: true + validates :nickname, presence: true + + validates :experience, presence: true, + numericality: { greater_than_or_equal_to: 1, only_integer: true } + + validates :level, presence: true, + numericality: { greater_than_or_equal_to: 1, only_integer: true } + + validates :hp, presence: true, + numericality: { greater_than_or_equal_to: 1, only_integer: true } + + validates :attack, presence: true, + numericality: { greater_than_or_equal_to: 1, only_integer: true } + + validates :defense, presence: true, + numericality: { greater_than_or_equal_to: 1, only_integer: true } + + validates :special_attack, presence: true, + numericality: { greater_than_or_equal_to: 1, only_integer: true } + + validates :special_defense, presence: true, + numericality: { greater_than_or_equal_to: 1, only_integer: true } + + validates :speed, presence: true, + numericality: { greater_than_or_equal_to: 1, only_integer: true } + + validates :coolness, presence: true, + numericality: { + greater_than_or_equal_to: 0, + less_than_or_equal_to: 10, + only_integer: true } + + validates :beauty, presence: true, + numericality: { + greater_than_or_equal_to: 0, + less_than_or_equal_to: 10, + only_integer: true } + + validates :cuteness, presence: true, + numericality: { + greater_than_or_equal_to: 0, + less_than_or_equal_to: 10, + only_integer: true } + + validates :smartness, presence: true, + numericality: { + greater_than_or_equal_to: 0, + less_than_or_equal_to: 10, + only_integer: true } + + validates :toughness, presence: true, + numericality: { + greater_than_or_equal_to: 0, + less_than_or_equal_to: 10, + only_integer: true } + + validates :sheen, presence: true, + numericality: { + greater_than_or_equal_to: 0, + less_than_or_equal_to: 10, + only_integer: true } + end +end diff --git a/app/models/pokeviewer/revision_move.rb b/app/models/pokeviewer/revision_move.rb new file mode 100644 index 0000000..74b9e9e --- /dev/null +++ b/app/models/pokeviewer/revision_move.rb @@ -0,0 +1,19 @@ +module Pokeviewer + class RevisionMove < ApplicationRecord + belongs_to :revision + belongs_to :move + + validates :number, presence: true, + numericality: { + greater_than_or_equal_to: 1, + less_than_or_equal_to: 4, + only_integer: true }, + uniqueness: { scope: :revision_id } + + validates :pp_bonuses, presence: true, + numericality: { + greater_than_or_equal_to: 0, + less_than_or_equal_to: 3, + only_integer: true} + end +end diff --git a/app/models/pokeviewer/species.rb b/app/models/pokeviewer/species.rb new file mode 100644 index 0000000..c69fd21 --- /dev/null +++ b/app/models/pokeviewer/species.rb @@ -0,0 +1,7 @@ +module Pokeviewer + class Species < ApplicationRecord + has_many :pokemon, dependent: :restrict_with_exception + + validates :name, presence: true, uniqueness: true + end +end diff --git a/app/models/pokeviewer/trainer.rb b/app/models/pokeviewer/trainer.rb new file mode 100644 index 0000000..1cef881 --- /dev/null +++ b/app/models/pokeviewer/trainer.rb @@ -0,0 +1,17 @@ +module Pokeviewer + class Trainer < ApplicationRecord + extend Enumerize + + has_many :pokemon, dependent: :nullify + + validates :number, presence: true, + numericality: { greater_than_or_equal_to: 0, only_integer: true } + + validates :name, presence: true, uniqueness: { + scope: :number, + message: "and number should be pairwise unique" } + + validates :game, presence: true + enumerize :game, in: [:ruby, :sapphire, :firered, :leafgreen, :emerald] + end +end diff --git a/config/initializers/inflection.rb b/config/initializers/inflection.rb new file mode 100644 index 0000000..6b76b93 --- /dev/null +++ b/config/initializers/inflection.rb @@ -0,0 +1,3 @@ +ActiveSupport::Inflector.inflections(:en) do |inflect| + inflect.uncountable 'pokemon' +end diff --git a/db/migrate/20170916225306_create_pokeviewer_trainers.rb b/db/migrate/20170916225306_create_pokeviewer_trainers.rb new file mode 100644 index 0000000..18e7952 --- /dev/null +++ b/db/migrate/20170916225306_create_pokeviewer_trainers.rb @@ -0,0 +1,13 @@ +class CreatePokeviewerTrainers < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_trainers do |t| + t.string :game, null: false + t.string :name, null: false, limit: 191 + t.integer :number, null: false + + t.timestamps + end + + add_index :pokeviewer_trainers, [:name, :number], unique: true + end +end diff --git a/db/migrate/20170916232015_create_pokeviewer_species.rb b/db/migrate/20170916232015_create_pokeviewer_species.rb new file mode 100644 index 0000000..e6d5c09 --- /dev/null +++ b/db/migrate/20170916232015_create_pokeviewer_species.rb @@ -0,0 +1,11 @@ +class CreatePokeviewerSpecies < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_species do |t| + t.string :name, null: false, limit: 191 + + t.timestamps + end + + add_index :pokeviewer_species, :name, unique: true + end +end diff --git a/db/migrate/20170916234251_create_pokeviewer_pokemon.rb b/db/migrate/20170916234251_create_pokeviewer_pokemon.rb new file mode 100644 index 0000000..dd9994c --- /dev/null +++ b/db/migrate/20170916234251_create_pokeviewer_pokemon.rb @@ -0,0 +1,31 @@ +class CreatePokeviewerPokemon < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_pokemon do |t| + t.string :uuid, null: false, limit: 191 + t.references :species, null: false + t.references :trainer, null: true + t.string :key, null: true, limit: 191 + t.string :ot_name, null: false + t.integer :ot_number, null: false + t.string :met_type, null: false + t.string :met_location, null: true + t.integer :met_level, null: false + t.boolean :shiny, null: false, default: false + t.string :nature, null: false + t.string :gender, null: false + t.boolean :second_ability, null: false + t.string :unown_letter, null: true, limit: 1 + + t.timestamps + end + + add_index :pokeviewer_pokemon, :uuid, unique: true + add_index :pokeviewer_pokemon, :key, unique: true + + add_foreign_key :pokeviewer_pokemon, :pokeviewer_species, + column: :species_id + + add_foreign_key :pokeviewer_pokemon, :pokeviewer_trainer, + column: :trainer_id + end +end diff --git a/db/migrate/20170917002857_create_pokeviewer_revisions.rb b/db/migrate/20170917002857_create_pokeviewer_revisions.rb new file mode 100644 index 0000000..f6755da --- /dev/null +++ b/db/migrate/20170917002857_create_pokeviewer_revisions.rb @@ -0,0 +1,31 @@ +class CreatePokeviewerRevisions < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_revisions do |t| + t.references :pokemon, null: false + t.integer :sequential_id, null: false + t.string :nickname, null: false + t.integer :experience, null: false + t.integer :level, null: false + t.integer :hp, null: false + t.integer :attack, null: false + t.integer :defense, null: false + t.integer :special_attack, null: false + t.integer :special_defense, null: false + t.integer :speed, null: false + t.integer :coolness, null: false + t.integer :beauty, null: false + t.integer :cuteness, null: false + t.integer :smartness, null: false + t.integer :toughness, null: false + t.integer :sheen, null: false + t.integer :hold_item, null: true + + t.timestamps + end + + add_index :pokeviewer_revisions, [:pokemon_id, :sequential_id], unique: true + + add_foreign_key :pokeviewer_revisions, :pokewalker_pokemon, + column: :pokemon_id + end +end diff --git a/db/migrate/20170917011102_create_pokeviewer_moves.rb b/db/migrate/20170917011102_create_pokeviewer_moves.rb new file mode 100644 index 0000000..86bf45f --- /dev/null +++ b/db/migrate/20170917011102_create_pokeviewer_moves.rb @@ -0,0 +1,12 @@ +class CreatePokeviewerMoves < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_moves do |t| + t.string :name, null: false, limit: 191 + t.integer :pp, null: false + + t.timestamps + end + + add_index :pokeviewer_moves, :name, unique: true + end +end diff --git a/db/migrate/20170917011258_create_pokeviewer_revision_moves.rb b/db/migrate/20170917011258_create_pokeviewer_revision_moves.rb new file mode 100644 index 0000000..e061207 --- /dev/null +++ b/db/migrate/20170917011258_create_pokeviewer_revision_moves.rb @@ -0,0 +1,20 @@ +class CreatePokeviewerRevisionMoves < ActiveRecord::Migration[5.1] + def change + create_table :pokeviewer_revision_moves do |t| + t.references :revision, null: false + t.references :move, null: false + t.integer :number, null: false + t.integer :pp_bonuses, null: false, default: 0 + + t.timestamps + end + + add_index :pokeviewer_revision_moves, [:revision_id, :number], unique: true + + add_foreign_key :pokeviewer_revision_moves, :pokeviewer_revisions, + column: :revision_id + + add_foreign_key :pokeviewer_revision_moves, :pokeviewer_moves, + column: :move_id + end +end diff --git a/lib/pokeviewer/engine.rb b/lib/pokeviewer/engine.rb index 456dc4a..d945d6d 100644 --- a/lib/pokeviewer/engine.rb +++ b/lib/pokeviewer/engine.rb @@ -1,3 +1,6 @@ +require "enumerize" +require "sequential" + module Pokeviewer class Engine < ::Rails::Engine isolate_namespace Pokeviewer diff --git a/pokeviewer.gemspec b/pokeviewer.gemspec index 3d3453f..bfc49ce 100644 --- a/pokeviewer.gemspec +++ b/pokeviewer.gemspec @@ -9,14 +9,16 @@ Gem::Specification.new do |s| s.version = Pokeviewer::VERSION s.authors = ["Kelly Rauchenberger"] s.email = ["fefferburbia@gmail.com"] - s.homepage = "TODO" - s.summary = "TODO: Summary of Pokeviewer." - s.description = "TODO: Description of Pokeviewer." + s.homepage = "https://github.com/hatkirby/pokeviewer" + s.summary = "Rails engine that displays Pokémon." + s.description = "Pokeviewer is a web interface that lets you display Pokémon that have been uploaded from a GBA using hatkirby/gen3uploader." s.license = "MIT" s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"] s.add_dependency "rails", "~> 5.1.4" + s.add_dependency "enumerize" + s.add_dependency "sequential" s.add_development_dependency "sqlite3" end diff --git a/test/dummy/db/schema.rb b/test/dummy/db/schema.rb new file mode 100644 index 0000000..4b5ad80 --- /dev/null +++ b/test/dummy/db/schema.rb @@ -0,0 +1,99 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20170917011258) do + + create_table "pokeviewer_moves", force: :cascade do |t| + t.string "name", limit: 191, null: false + t.integer "pp", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["name"], name: "index_pokeviewer_moves_on_name", unique: true + end + + create_table "pokeviewer_pokemon", force: :cascade do |t| + t.string "uuid", limit: 191, null: false + t.integer "species_id", null: false + t.integer "trainer_id" + t.string "key", limit: 191 + t.string "ot_name", null: false + t.integer "ot_number", null: false + t.string "met_type", null: false + t.string "met_location" + t.integer "met_level", null: false + t.boolean "shiny", default: false, null: false + t.string "nature", null: false + t.string "gender", null: false + t.boolean "second_ability", null: false + t.string "unown_letter", limit: 1 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["key"], name: "index_pokeviewer_pokemon_on_key", unique: true + t.index ["species_id"], name: "index_pokeviewer_pokemon_on_species_id" + t.index ["trainer_id"], name: "index_pokeviewer_pokemon_on_trainer_id" + t.index ["uuid"], name: "index_pokeviewer_pokemon_on_uuid", unique: true + end + + create_table "pokeviewer_revision_moves", force: :cascade do |t| + t.integer "revision_id", null: false + t.integer "move_id", null: false + t.integer "number", null: false + t.integer "pp_bonuses", default: 0, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["move_id"], name: "index_pokeviewer_revision_moves_on_move_id" + t.index ["revision_id", "number"], name: "index_pokeviewer_revision_moves_on_revision_id_and_number", unique: true + t.index ["revision_id"], name: "index_pokeviewer_revision_moves_on_revision_id" + end + + create_table "pokeviewer_revisions", force: :cascade do |t| + t.integer "pokemon_id", null: false + t.integer "sequential_id", null: false + t.string "nickname", null: false + t.integer "experience", null: false + t.integer "level", null: false + t.integer "hp", null: false + t.integer "attack", null: false + t.integer "defense", null: false + t.integer "special_attack", null: false + t.integer "special_defense", null: false + t.integer "speed", null: false + t.integer "coolness", null: false + t.integer "beauty", null: false + t.integer "cuteness", null: false + t.integer "smartness", null: false + t.integer "toughness", null: false + t.integer "sheen", null: false + t.integer "hold_item" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["pokemon_id", "sequential_id"], name: "index_pokeviewer_revisions_on_pokemon_id_and_sequential_id", unique: true + t.index ["pokemon_id"], name: "index_pokeviewer_revisions_on_pokemon_id" + end + + create_table "pokeviewer_species", force: :cascade do |t| + t.string "name", limit: 191, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["name"], name: "index_pokeviewer_species_on_name", unique: true + end + + create_table "pokeviewer_trainers", force: :cascade do |t| + t.string "game", null: false + t.string "name", limit: 191, null: false + t.integer "number", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["name", "number"], name: "index_pokeviewer_trainers_on_name_and_number", unique: true + end + +end diff --git a/test/fixtures/pokeviewer/moves.yml b/test/fixtures/pokeviewer/moves.yml new file mode 100644 index 0000000..453cab6 --- /dev/null +++ b/test/fixtures/pokeviewer/moves.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + pp: 1 + +two: + name: MyString + pp: 1 diff --git a/test/fixtures/pokeviewer/pokemon.yml b/test/fixtures/pokeviewer/pokemon.yml new file mode 100644 index 0000000..750cc53 --- /dev/null +++ b/test/fixtures/pokeviewer/pokemon.yml @@ -0,0 +1,31 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + species: one + trainer: one + key: MyString + ot_name: MyString + ot_number: 1 + met_type: MyString + met_location: MyString + met_level: 1 + shiny: false + nature: MyString + gender: MyString + second_ability: false + unown_letter: + +two: + species: two + trainer: two + key: MyString + ot_name: MyString + ot_number: 1 + met_type: MyString + met_location: MyString + met_level: 1 + shiny: false + nature: MyString + gender: MyString + second_ability: false + unown_letter: diff --git a/test/fixtures/pokeviewer/revision_moves.yml b/test/fixtures/pokeviewer/revision_moves.yml new file mode 100644 index 0000000..f70fda1 --- /dev/null +++ b/test/fixtures/pokeviewer/revision_moves.yml @@ -0,0 +1,13 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + revision: one + move: one + number: 1 + pp_bonuses: 1 + +two: + revision: two + move: two + number: 1 + pp_bonuses: 1 diff --git a/test/fixtures/pokeviewer/revisions.yml b/test/fixtures/pokeviewer/revisions.yml new file mode 100644 index 0000000..eddd53f --- /dev/null +++ b/test/fixtures/pokeviewer/revisions.yml @@ -0,0 +1,55 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + pokemon: one + nickname: MyString + experience: 1 + level: 1 + hp: 1 + attack: 1 + defense: 1 + special_attack: 1 + special_defense: 1 + speed: 1 + coolness: 1 + beauty: 1 + cuteness: 1 + smartness: 1 + toughness: 1 + sheen: 1 + move1: one + move2: one + move3: one + move4: one + move1_pp: 1 + move2_pp: 1 + move3_pp: 1 + move4_pp: 1 + hold_item: 1 + +two: + pokemon: two + nickname: MyString + experience: 1 + level: 1 + hp: 1 + attack: 1 + defense: 1 + special_attack: 1 + special_defense: 1 + speed: 1 + coolness: 1 + beauty: 1 + cuteness: 1 + smartness: 1 + toughness: 1 + sheen: 1 + move1: two + move2: two + move3: two + move4: two + move1_pp: 1 + move2_pp: 1 + move3_pp: 1 + move4_pp: 1 + hold_item: 1 diff --git a/test/fixtures/pokeviewer/species.yml b/test/fixtures/pokeviewer/species.yml new file mode 100644 index 0000000..e5cbf31 --- /dev/null +++ b/test/fixtures/pokeviewer/species.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + number: 1 + name: MyString + +two: + number: 1 + name: MyString diff --git a/test/fixtures/pokeviewer/trainers.yml b/test/fixtures/pokeviewer/trainers.yml new file mode 100644 index 0000000..0675334 --- /dev/null +++ b/test/fixtures/pokeviewer/trainers.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + game: MyString + name: MyString + number: + +two: + game: MyString + name: MyString + number: diff --git a/test/models/pokeviewer/move_test.rb b/test/models/pokeviewer/move_test.rb new file mode 100644 index 0000000..8737c3f --- /dev/null +++ b/test/models/pokeviewer/move_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +module Pokeviewer + class MoveTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end + end +end diff --git a/test/models/pokeviewer/pokemon_test.rb b/test/models/pokeviewer/pokemon_test.rb new file mode 100644 index 0000000..76b61cf --- /dev/null +++ b/test/models/pokeviewer/pokemon_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +module Pokeviewer + class PokemonTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end + end +end diff --git a/test/models/pokeviewer/revision_move_test.rb b/test/models/pokeviewer/revision_move_test.rb new file mode 100644 index 0000000..7f716f8 --- /dev/null +++ b/test/models/pokeviewer/revision_move_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +module Pokeviewer + class RevisionMoveTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end + end +end diff --git a/test/models/pokeviewer/revision_test.rb b/test/models/pokeviewer/revision_test.rb new file mode 100644 index 0000000..1f9e430 --- /dev/null +++ b/test/models/pokeviewer/revision_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +module Pokeviewer + class RevisionTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end + end +end diff --git a/test/models/pokeviewer/species_test.rb b/test/models/pokeviewer/species_test.rb new file mode 100644 index 0000000..26f3218 --- /dev/null +++ b/test/models/pokeviewer/species_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +module Pokeviewer + class SpeciesTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end + end +end diff --git a/test/models/pokeviewer/trainer_test.rb b/test/models/pokeviewer/trainer_test.rb new file mode 100644 index 0000000..72f3655 --- /dev/null +++ b/test/models/pokeviewer/trainer_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +module Pokeviewer + class TrainerTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end + end +end -- cgit 1.4.1