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
#start a new game by calling Game.new with player names as params, i.e. g = Game.new("Nick", "Mike") | |
#the Game object will contain the deck & the players. | |
#A new Deck will be automatically reloaded as soon as all cards are gone. | |
#As a result, you can play endless hands of blackjack. | |
SUITS = %w{clubs hearts spades diamonds} | |
VALUES = ["2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A"] | |
AMOUNTS = [2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 11] |
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
require 'spec_helper' | |
describe 'Member Signup Page' do | |
it 'loads the signup form' do | |
visit '/members/new' | |
page.should have_content('Signup') | |
end | |
it "creates a new member in the database" 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
field_type = params[:form_field][:field_type] | |
case field_type | |
when 'text' | |
@form_field.code = %Q{<input type="text" name="#{@form_field.id}-text-field" class="text-input">} | |
when 'radio' | |
@field_option.code = %Q{<input type="radio" name="form_field_#{@form_field.id}-radio_field_#{@field_option.id}" class="radio-option-label">} | |
@field_option.save | |
when 'checkbox' | |
@field_option.code = %Q{<input type="checkbox" name="form_field_#{@form_field.id}-checkbox_field_#{@field_option.id}" class="checkbox-option-label">} | |
@field_option.save |
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
<%= form_for [@website, @billboard], :html => { :multipart => true } do |f| %> | |
<div class="row_margin_bottom"> | |
<%= f.label :name %> | |
<%= f.text_field :name %> | |
</div> | |
<div class="form_row"> | |
<%= label_tag :photos %> | |
<div class="billboard-container"> |
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
describe '#photo_url' do | |
it { | |
VCR.use_cassette('cloudinary') do | |
product.update_attributes(picture: File.open("#{Rails.root}/app/assets/images/image_for_testing.jpg")) | |
response = product.picture | |
UserSite::ProductPresenter.new(product, self).photo_url.should == response | |
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
<div class="section-container auto" data-section> | |
<section> | |
<p class="title" data-section-title><a href="#panel2">Categories & Products</a></p> | |
<div class="content" data-section-content> | |
<div class="row row-spacing"> | |
<div class="large-12 columns product-list"> | |
<%= form_for([:site_manager, @page, @product], :html => {id: 'new_product'}) do |u| %> | |
<% error_keys = get_fields_with_errors(flash) %> |
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
$(".cloudinary-fileupload") | |
.bind('fileuploadprogress', function(e, data) { | |
console.log('fileuploadprogress') | |
}) | |
.off("cloudinarydone").on("cloudinarydone", function (e, data) { | |
console.log('in it') | |
}) | |
.fileupload({ | |
// Uncomment the following lines to enable client side image resizing and valiation. | |
// Make sure cloudinary/processing is included the js file |
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
function updateItemSummary() { | |
var size = $('form.build-product-form input[name=size]:checked').val(), | |
medium = $('input[name=medium_id]:checked').next().children('span').html(), | |
option = ($('input[name=medium_option]:checked').val() == 'none') ? 'not applicable' : $('input[name=medium_option]:checked').next().children('span').html(), | |
style = $('input[name=style]:checked').next().children('span').html(), | |
frame = $('input[name=frame_id]:checked').next().children('span').html(), | |
summary = '<b>Size:</b> ' + size + | |
'<br /><b>Medium:</b> ' + medium + | |
'<br /><b>Option:</b> ' + option + | |
'<br /><b>Style:</b> ' + style + |
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
Failures: | |
1) MicropostMailer sends a feed update email to administrator | |
Failure/Error: create_micropost(@website, @user) | |
Capybara::Ambiguous: | |
Ambiguous match, found 2 elements matching css "#micropost_group_1" | |
# ./spec/helper_methods/application_spec_methods.rb:262:in `create_micropost' | |
# ./spec/mailers/micropost_mailer_spec.rb:14:in `block (2 levels) in <top (required)>' | |
2) Website visits statistics page successfully |
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
1) Website creates, updates, and deletes a website | |
Failure/Error: Unable to find matching line from backtrace | |
VCR::Errors::UnhandledHTTPRequestError: | |
================================================================================ | |
An HTTP request has been made that VCR does not know how to handle: | |
POST https://api.cloudinary.com/v1_1/decosites/auto/upload | |
There is currently no cassette in use. There are a few ways |