diff --git a/.ruby-gemset b/.ruby-gemset new file mode 100644 index 00000000..127657ca --- /dev/null +++ b/.ruby-gemset @@ -0,0 +1 @@ +rstatus diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 00000000..227cea21 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.0.0 diff --git a/.rvmrc.example b/.rvmrc.example deleted file mode 100644 index f7fa9735..00000000 --- a/.rvmrc.example +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env bash - -# This is an RVM Project .rvmrc file, used to automatically load the ruby -# development environment upon cd'ing into the directory - -# First we specify our desired [@], the @gemset name is optional. -environment_id="ruby-1.9.2@rstatus" - -# -# First we attempt to load the desired environment directly from the environment -# file, this is very fast and efficicent compared to running through the entire -# CLI and selector. If you want feedback on which environment was used then -# insert the word 'use' after --create as this triggers verbose mode. -# -if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \ - && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]] ; then - \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id" -else - # If the environment file has not yet been created, use the RVM CLI to select. - rvm --create "$environment_id" -fi - -# -# If you use an RVM gemset file to install a list of gems (*.gems), you can have -# it be automatically loaded, uncomment the following and adjust the filename if -# necessary. -# -# filename=".gems" -# if [[ -s "$filename" ]] ; then -# rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d' -# fi - -# -# If you use bundler and would like to run bundle each time you enter the -# directory you can uncomment the following code. -# -# # Ensure that Bundler is installed, install it if it is not. -# if ! command -v bundle ; then -# printf "The rubygem 'bundler' is not installed, installing it now.\n" -# gem install bundler -# fi -# -# # Bundle while redcing excess noise. -# printf "Bundling your gems this may take a few minutes on a fresh clone.\n" -# bundle | grep -v 'Using' | grep -v 'complete' | sed '/^$/d' -# - diff --git a/.travis.yml b/.travis.yml index 07f1bcf7..383c60fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ language: ruby rvm: - 1.9.3 + - 2.0.0 + - 2.1.3 services: - mongodb - elasticsearch diff --git a/Gemfile b/Gemfile index feae197c..a1527419 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,5 @@ source 'http://rubygems.org' -ruby '1.9.3' - gem 'rails', '3.2.14' # Gems used only for assets and not required diff --git a/README.md b/README.md index 96e1b9aa..fc3c8888 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Edit your profile and attach your twitter account if you want. ## Quick facts and links -- The stack: ruby/rails 3.2/mongodb +- The stack: ruby (1.9.3 OR 2.0.0 OR 2.1.3)/rails 3.2/mongodb - [The code][code] - [The documentation][docs] (We could use lots of improvement here!) - [The Issues list][issues] @@ -120,9 +120,9 @@ Edit your profile and attach your twitter account if you want. If you'd like to contribute, we'd love to have you! Your first order of business is setting up a development environment and making sure all the tests pass on your system. Rstat.us is a Ruby on Rails 3.2 application, so it's -assumed you already have [Ruby](http://www.ruby-lang.org/en/downloads) (1.9.2 -or 1.9.3 preferred, 1.8.7 compatibility is not guaranteed), rubygems (comes -with Ruby as of 1.9.2), and [bundler](http://gembundler.com/) on your machine. +assumed you already have [Ruby](http://www.ruby-lang.org/en/downloads) (1.9.3, 2.0.0 +or 2.1.3 preferred, 1.8.7/1.9.2 compatibility is not guaranteed), rubygems (comes +with Ruby), and [bundler](http://gembundler.com/) on your machine. If not, each of those links has instructions, and we're willing to help via one of the contact methods above if you have issues. @@ -148,8 +148,6 @@ bug_. For example, [this is an issue with running a development environment on windows](https://github.com/hotsh/rstat.us/issues/547) that we need to fix. Please report any issues you have. -If you use RVM, you'll want to copy `.rvmrc.example` to `.rvmrc`. - ### Getting a local version running First off: you will need MongoDB (www.mongodb.org). They have a [quickstart @@ -172,7 +170,7 @@ generated for you and your config.yml file updated. When you run tests a new random SECRET_TOKEN will be generated each time. You can always copy config/config.yml.sample to config/config.yml and edit it on your own beforehand. -- encoding is UTF-8 by default for ruby 1.9.3 +- encoding is UTF-8 by default - Notes about config settings are in the example file (config/config.yml.example) And start the server: diff --git a/test/acceptance/search_test.rb b/test/acceptance/search_test.rb index 75f79aab..50f74444 100644 --- a/test/acceptance/search_test.rb +++ b/test/acceptance/search_test.rb @@ -32,7 +32,9 @@ it "allows access to search" do search_for("droids") - assert_match @update_text, page.body + within '#search' do + assert has_text? @update_text + end end end @@ -47,7 +49,9 @@ it "allows access to search" do search_for("droids") - assert_match @update_text, page.body + within '#search' do + assert has_text? @update_text + end end it "returns updates on blank search" do @@ -71,25 +75,33 @@ it "gets a match for a word in the update" do search_for("droids") - assert_match @update_text, page.body + within '#search' do + assert has_text? @update_text + end end it "doesn't get a match for a substring ending a word in the update" do search_for("roids") - assert_match "No statuses match your search.", page.body + within '#content' do + assert has_text? "No statuses match your search." + end end it "doesn't get a match for a substring starting a word in the update" do search_for("loo") - assert_match "No statuses match your search.", page.body + within '#content' do + assert has_text? "No statuses match your search." + end end it "gets a case-insensitive match for a word in the update" do search_for("DROIDS") - assert_match @update_text, page.body + within '#search' do + assert has_text? @update_text + end end it "gets a match for hashtag search" do diff --git a/test/enhancements/elasticsearch_test.rb b/test/enhancements/elasticsearch_test.rb index 78900885..8c88d464 100644 --- a/test/enhancements/elasticsearch_test.rb +++ b/test/enhancements/elasticsearch_test.rb @@ -22,6 +22,8 @@ it "gets a match for words in the update out of order" do search_for("for looking") - assert_match @update_text, page.body + within '#search' do + assert has_text? @update_text + end end end