Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.4'
# Use postgresql as the database for Active Record
gem 'pg', '~> 0.18'
gem 'pg', '~> 0.21.0'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
Expand Down
59 changes: 58 additions & 1 deletion test/controllers/movies_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,71 @@
Movie.count.must_equal count+1
end

it "does not create movie with bad params" do
it "does not create movie with no title" do
params = {
overview: "awesome movie about awesome people",
release_date: "2018-10-10",
inventory: "5"
}
count = Movie.count

post movies_path, params: params
must_respond_with :bad_request

body = JSON.parse(response.body)
body.must_equal "errors" => {"title" => ["can't be blank"]}

Movie.count.must_equal count
end

it "does not create movie with no overview" do
params = {
title: "awesome movie 1",
release_date: "2018-10-10",
inventory: "5"
}
count = Movie.count

post movies_path, params: params
must_respond_with :bad_request

body = JSON.parse(response.body)
body.must_equal "errors" => {"overview" => ["can't be blank"]}

Movie.count.must_equal count
end

it "does not create movie with no release_date" do
params = {
title: "awesome movie 1",
overview: "awesome movie about awesome people",
inventory: "5"
}
count = Movie.count

post movies_path, params: params
must_respond_with :bad_request

body = JSON.parse(response.body)
body.must_equal "errors" => {"release_date" => ["can't be blank"]}

Movie.count.must_equal count
end

it "does not create movie with no inventory" do
params = {
title: "awesome movie 1",
overview: "awesome movie about awesome people",
release_date: "2018-10-10"
}

count = Movie.count
post movies_path, params: params
must_respond_with :bad_request

body = JSON.parse(response.body)
body.must_equal "errors" => {"inventory" => ["can't be blank"]}

Movie.count.must_equal count
end
end
Expand Down
58 changes: 58 additions & 0 deletions vendor/bundle/ruby/2.3.0/gems/awesome_print-1.8.0/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
PATH
remote: .
specs:
awesome_print (1.8.0)

GEM
remote: https://rubygems.org/
specs:
appraisal (2.2.0)
bundler
rake
thor (>= 0.14.0)
codeclimate-test-reporter (1.0.8)
simplecov (<= 0.13)
diff-lcs (1.3)
docile (1.1.5)
fakefs (0.11.0)
json (2.1.0)
mini_portile2 (2.2.0)
nokogiri (1.8.0)
mini_portile2 (~> 2.2.0)
rake (12.0.0)
rspec (3.6.0)
rspec-core (~> 3.6.0)
rspec-expectations (~> 3.6.0)
rspec-mocks (~> 3.6.0)
rspec-core (3.6.0)
rspec-support (~> 3.6.0)
rspec-expectations (3.6.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.6.0)
rspec-mocks (3.6.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.6.0)
rspec-support (3.6.0)
simplecov (0.13.0)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.1)
sqlite3 (1.3.13)
thor (0.19.4)

PLATFORMS
ruby

DEPENDENCIES
appraisal
awesome_print!
codeclimate-test-reporter
fakefs (>= 0.2.1)
nokogiri (>= 1.6.5)
rspec (>= 3.0.0)
simplecov
sqlite3

BUNDLED WITH
1.14.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
install:
echo "Nada."
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 18 additions & 0 deletions vendor/bundle/ruby/2.3.0/gems/nio4r-2.1.0/ext/nio4r/nio4r_ext.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (c) 2011-2017 Tony Arcieri. Distributed under the MIT License.
* See LICENSE.txt for further details.
*/

#include "nio4r.h"
#include "../libev/ev.c"

void Init_NIO_Selector();
void Init_NIO_Monitor();
void Init_NIO_ByteBuffer();

void Init_nio4r_ext()
{
Init_NIO_Selector();
Init_NIO_Monitor();
Init_NIO_ByteBuffer();
}
Binary file not shown.
Binary file not shown.
Binary file not shown.