Skip to content

Commit

Permalink
created movie model
Browse files Browse the repository at this point in the history
  • Loading branch information
aruna79 committed May 7, 2018
1 parent 90eb69d commit 8ca9539
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/movie.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Movie < ApplicationRecord
end
12 changes: 12 additions & 0 deletions db/migrate/20180507212242_create_movies.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CreateMovies < ActiveRecord::Migration[5.1]
def change
create_table :movies do |t|
t.string :title
t.string :overview
t.date :release_date
t.integer :inventory

t.timestamps
end
end
end
13 changes: 13 additions & 0 deletions test/fixtures/movies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
title: MyString
overview: MyString
release_date: 2018-05-07
inventory: 1

two:
title: MyString
overview: MyString
release_date: 2018-05-07
inventory: 1
9 changes: 9 additions & 0 deletions test/models/movie_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require "test_helper"

describe Movie do
let(:movie) { Movie.new }

it "must be valid" do
value(movie).must_be :valid?
end
end

0 comments on commit 8ca9539

Please sign in to comment.