Giter VIP home page Giter VIP logo

sample-test's Introduction

Sample Test for new Code-Check

Code-Check is a web service which we are going to develop in 2015. It provides users the system to make various coding tests and the interface to solve tests. This is a prototype for it.

Purpose

  • Measuring developing skills of candidates.
  • Helping candidates to understand how to develop in Givery.(Using api-first-spec)
  • Considering what the new code-check test should be.

Test

  • We want you to implement some REST APIs by using any languages and frameworks.
  • You can see the specification of APIs in spec directory.
    • These specs are written with api-first-spec, and has some API tests.
  • Your goal is to develop a web application which be able to pass all these tests.

How to solve the test

This test requires

  • Some web application framework
  • MySQL database
  • GitHub account(To fork this repository.)

Fork this repository to your GitHub account at first. And then, develop an application by yourself.

Database structure and sample data are written in sql/create.sql.
Build your own mysql server and run this script.

If you want to build it automatically, you can use our test env builder

You can set up an environment with following commands.

git clone [email protected]:code-check/env-builder.git test-env
cd test-env
cp Vagrantfile.sample Vagrantfile
cp hosts.sample hosts
vagrant up
ansible-playbook all.yml
vagrant ssh
git clone [email protected]:[YOUR GITHUB ACCOUNT]/sample-test.git
mysql -uvagrant -pvagrant -Dvagrant < sample-test/sql/create.sql

cd sample-test

And then, implement the app and push to your REPO.

How to run the api-first-spec test

api-first-spec uses Mocha test framework.

You can run all tests with following commands.

cd sample-test
npm install
mocha spec/*

Of course you can try running a single test.

mocha spec/users_login.js

As default, application settings are defined in spec/config/config.json.
You can edit it easy to use.

Questions

This app is simple event reserve system.

  • It has two kind of users.
    • student
    • company
  • All users can see every event list. (include none logged-in user)
  • The student can reserve and unreserve the event.
  • The company can see their own event list.

Q1. Implement login API.

  • Login with email and password
  • Its response is login token and user data
    • group_id = 1 is student user.
    • group_id = 2 is company user.

Q2. Implement event_list API for students

  • Login is not required
  • "from" parameter is required.
    • It specify the date list start from.
  • "offset" and "limit" parameter are option.

Q3. Implement reserve and unreserve API

  • Login is required.
  • The user must be student.

Q4. Implement event_list API for companies

  • Login is required.
  • The user must be company.
  • The event information includes the number of attendees.

Q5. Refactoring

If you are a manager of this project and you can change the specification of this app, what would you do?

Write your opinion to answer.md

How to submit your answer

  • Please let us know about your answer by writing on issue.
    • Enter "implemented" into the title.
    • Write your repository URL on the comment.

Support

If you have any questions, please write it to this repository's issue.

This is experimental case of our new service.
So, any feedback is welcome!

sample-test's People

Contributors

maximum80 avatar shunjikonishi avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.