Sha256: 3805895d00035179432867f3f518290f28a42306c3984d6b615d98d0befbe76a

Contents?: true

Size: 962 Bytes

Versions: 6

Compression:

Stored size: 962 Bytes

Contents

# encoding: UTF-8
require File.expand_path(File.dirname(__FILE__) + '/acceptance_helper')

class HandsetDetectionController < ApplicationController
  def index
    render :inline => <<-ERB
      <% if galakei? %>
        <% if request.docomo? %>
          docomo
        <% elsif request.au? %>
          au
        <% elsif request.softbank? %>
          softbank
        <% end %>
      <% else %>
        not galakei
      <% end %>
    ERB
  end
end


feature 'handset detection' do
  scenario 'for docomo', :driver => :docomo do
    visit '/handset_detection'
    page.body.should match("docomo")
  end

  scenario 'for au', :driver => :au do
    visit '/handset_detection'
    page.body.should match("au")
  end

  scenario 'for softbank', :driver => :softbank do
    visit '/handset_detection'
    page.body.should match("softbank")
  end

  scenario 'for non galakei' do
    visit '/handset_detection'
    page.body.should match("not galakei")
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
galakei-0.3.8 spec/acceptance/handset_detection_spec.rb
galakei-0.3.7 spec/acceptance/handset_detection_spec.rb
galakei-0.3.6 spec/acceptance/handset_detection_spec.rb
galakei-0.3.5 spec/acceptance/handset_detection_spec.rb
galakei-0.3.4 spec/acceptance/handset_detection_spec.rb
galakei-0.3.3 spec/acceptance/handset_detection_spec.rb