This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/models/user_spec.rb` in client | |
it 'should be able to create a user with remote_factory_girl' do | |
user = RemoteFactoryGirl.create(:user, first_name: 'Sam') | |
expect(user.first_name).to eq('Sam') | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/spec_helper.rb` in client | |
RSpec.configure do |config| | |
config.before(:suite) do | |
RemoteDatabaseCleaner.clean | |
end | |
config.after(:each) do | |
RemoteDatabaseCleaner.clean | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/models/user_spec.rb | |
it "should be able to create a user with factory_girl" do | |
user = FactoryGirl.create(:user, first_name: 'Sam') | |
expect(user.first_name).to eq('Sam') | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/spec_helper.rb in client | |
... | |
require 'rspec/rails' | |
require 'database_cleaner' | |
... | |
RSpec.configure do |config| | |
config.before(:suite) do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/factories/users.rb | |
FactoryGirl.define do | |
factory :user do | |
sequence(:email) { |n| "user#{n}@bignerdranch.com" } | |
sequence(:username) { |n| "user#{n}" } | |
password 'test123' | |
password_confirmation 'test123' | |
terms_of_use true | |
confirmed_at Time.now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DashboardController < ApplicationController | |
before_filter :authenticate_diver! | |
authorize_resource | |
def show | |
@divers = Dashboard.new.divers(current_diver) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DashboardController < ApplicationController | |
before_filter :authenticate_diver! | |
authorize_resource | |
def show | |
if current_diver.role == 'admin' | |
@boat_logs = BoatLog.all | |
elsif current_diver.role == 'manager' | |
@boat_logs = BoatLog.where( "boatlog_manager_id=?", current_diver.boatlog_manager_id ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app/models/model.rb | |
class Model < ActiveRecord::Base | |
include Tire::Model::Search | |
include Tire::Model::Callbacks | |
index_name INDEX_NAME | |
.... | |
.... | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.project-eval .credit-details td { padding-left: 30px; padding-bottom: 8px; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$TB_jq(document).ready(function(){ | |
// Hide all initially | |
$TB_jq(".distance-description-text").hide(); | |
// Toggle visible and non-visible | |
$TB_jq('.distance-description').toggle( | |
function() { |