Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST: Add test case for task get submission details #2

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ env:
- DF_SECRET_KEY_BASE=test_staging
- DF_SECRET_KEY_ATTR=test_staging
- DF_SECRET_KEY_DEVISE=test_staging
- CC_TEST_REPORTER_ID=355f46e3aec53ec2d17f714bd0eab58682dc03ee413d46195440311da30982c7

# Enable postgresql and MySQL service
services:
Expand All @@ -52,6 +53,9 @@ install:
- bundle install --without production replica
- rbenv rehash
- export PATH=/tmp/texlive/bin/x86_64-linux:$PATH
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build

# Set the environment before running the tests
before_script:
Expand Down Expand Up @@ -86,3 +90,6 @@ script:
- which lualatex
- PATH=/tmp/texlive/bin/x86_64-linux:$PATH bundle exec rake test
- PATH=/tmp/texlive/bin/x86_64-linux:$PATH RAILS_ENV=staging bundle exec rake test

after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ group :development, :test do
gem 'factory_girl_rails'
gem 'minitest-around'
gem 'minitest-hyper'
gem 'minitest-osx'
gem 'minitest-rails'
gem 'byebug'
gem 'simplecov', require: false
Expand Down
5 changes: 0 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ GEM
minitest-around (0.4.0)
minitest (~> 5.0)
minitest-hyper (0.2.0)
minitest-osx (0.1.0)
minitest (~> 5.4)
terminal-notifier (~> 1.6)
minitest-rails (2.2.1)
minitest (~> 5.7)
railties (~> 4.1)
Expand Down Expand Up @@ -239,7 +236,6 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
terminal-notifier (1.6.3)
thin (1.7.0)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
Expand Down Expand Up @@ -281,7 +277,6 @@ DEPENDENCIES
json-jwt (= 1.7.0)
minitest-around
minitest-hyper
minitest-osx
minitest-rails
moss_ruby (= 1.1.2)
mysql2
Expand Down
1 change: 1 addition & 0 deletions how.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
How you doin'?
12 changes: 12 additions & 0 deletions test/api/tasks_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,16 @@ def test_task_get
# assert_json_matches_model r, expected_data[i].as_json, ['id', 'tutorial_id', 'task_definition_id', 'status']
end
end

def test_task_get_unauthorized
get '/api/tasks?unit_id=1'

assert_equal 419, last_response.status
end

def test_get_submission_details_unauthorized
get '/api/projects/1/task_def_id/1/submission_details'

assert_equal 419, last_response.status
end
end
1 change: 0 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# Require minitest extensions
require 'minitest/rails'
require 'minitest/pride'
require 'minitest/osx'
require 'minitest/around'

# Require all test helpers
Expand Down