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

Integrate Travis CI #19

Merged
merged 7 commits into from
Apr 23, 2015
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
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: ruby
rvm:
- 1.9.3
addons:
postgresql: '9.1'
before_script:
- psql -c 'create database travis_ci_test;' -U postgres
- cp config/database.yml.travis config/database.yml
script: 'bundle exec rake'
deploy:
provider: heroku
api_key:
secure: Mh5IwVSTucNXGx76lD/te6lo0DFo34sYizmTYSGlv2xipdD+4+zfRrJ4C1z/qby/VObvJ71doPOSQAqHHE81RXtDe0fZLBWHSmfLwZqtvEusQwrzmyzRfld4IBdOcOowV0BDt5h6VSjMR1k2LvpQsWESk6+Ow1rHd6/90AbhsGA=

app:
master: networking-portal-production
staging: networking-portal-staging

run:
- "rake db:migrate"
- restart
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', group: :development
gem 'sqlite3', group: [:development, :test]
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
Expand Down
26 changes: 26 additions & 0 deletions config/database.yml.travis
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000

development:
<<: *default
database: db/development.sqlite3

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: postgresql
database: travis_ci_test
username: postgres

production:
<<: *default
database: db/production.sqlite3
9 changes: 0 additions & 9 deletions test/controllers/alumni_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
require 'test_helper'

class AlumniControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
end

test "should get show" do
get :show
assert_response :success
end

end
4 changes: 0 additions & 4 deletions test/controllers/alumni_data_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
require 'test_helper'

class AlumniDataControllerTest < ActionController::TestCase
test "should get update" do
get :update
assert_response :success
end

end
9 changes: 0 additions & 9 deletions test/controllers/student_member_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
require 'test_helper'

class StudentMemberControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
end

test "should get show" do
get :show
assert_response :success
end

end
10 changes: 5 additions & 5 deletions test/fixtures/admin_users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value
# one: {}
# # column: value
# #
# two: {}
# # column: value
17 changes: 7 additions & 10 deletions test/fixtures/alumnis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
name: MyString
year: MyString
hall: MyString

two:
name: MyString
year: MyString
hall: MyString
<% 10.times do |n| %>
alumni_<%= n %>:
id: <%= "#{n}" %>
name: <%= "alumni#{n}" %>
year: <%= "#{n}" %>
hall: SH
<% end %>
18 changes: 8 additions & 10 deletions test/fixtures/coordinators.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
name: MyString
rollnum: MyString
portfolio: MyString

two:
name: MyString
rollnum: MyString
portfolio: MyString
<% 10.times do |n| %>
coordinator_<%= n %>:
id: <%= "#{n}" %>
name: <%= "coordinator#{n}" %>
rollnum: <%= "coordinator#{n}" %>
portfolio: Some portfolio
email: <%= "coordintor#{n}@g.com" %>
<% end %>
18 changes: 8 additions & 10 deletions test/fixtures/student_members.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
name: MyString
rollnum: MyString
portfolio: MyString

two:
name: MyString
rollnum: MyString
portfolio: MyString
<% 10.times do |n| %>
student_<%= n %>:
id: <%= "#{n}" %>
name: <%= "student#{n}" %>
rollnum: <%= "student#{n}" %>
portfolio: Some portfolio
email: <%= "coordintor#{n}@g.com" %>
<% end %>
16 changes: 16 additions & 0 deletions test/models/alumni_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
require 'test_helper'

class AlumniTest < ActiveSupport::TestCase

test "number_of_records_being_created" do
a = Alumni.count
assert_equal a, 10, "The ten alumni were not created"
end

test "records_being_created" do
a = Alumni.find(5)
assert_equal a.id, 5, "The ID is not equal"
end

# test "validations_of_columns" do
# alumni = Alumni.new
# alumni.name = "Something"
# assert_not alumni.save, "The alumni was saved even though there was no hall or department given."
# end
# test "the truth" do
# assert true
# end
Expand Down