Sha256: e570de158c070e0038d00c64989f629831a3642e36a33e343c98c34eb605b581

Contents?: true

Size: 961 Bytes

Versions: 35

Compression:

Stored size: 961 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

35 entries across 35 versions & 1 rubygems

Version Path
galakei-0.13.7 spec/acceptance/handset_detection_spec.rb
galakei-0.13.6 spec/acceptance/handset_detection_spec.rb
galakei-0.13.5 spec/acceptance/handset_detection_spec.rb
galakei-0.13.4 spec/acceptance/handset_detection_spec.rb
galakei-0.13.3 spec/acceptance/handset_detection_spec.rb
galakei-0.13.2 spec/acceptance/handset_detection_spec.rb
galakei-0.13.1 spec/acceptance/handset_detection_spec.rb
galakei-0.13.0 spec/acceptance/handset_detection_spec.rb
galakei-0.12.1 spec/acceptance/handset_detection_spec.rb
galakei-0.12.0 spec/acceptance/handset_detection_spec.rb
galakei-0.11.3 spec/acceptance/handset_detection_spec.rb
galakei-0.11.2 spec/acceptance/handset_detection_spec.rb
galakei-0.11.1 spec/acceptance/handset_detection_spec.rb
galakei-0.11.0 spec/acceptance/handset_detection_spec.rb
galakei-0.10.1 spec/acceptance/handset_detection_spec.rb
galakei-0.10.0 spec/acceptance/handset_detection_spec.rb
galakei-0.9.1 spec/acceptance/handset_detection_spec.rb
galakei-0.9.0 spec/acceptance/handset_detection_spec.rb
galakei-0.8.1 spec/acceptance/handset_detection_spec.rb
galakei-0.8.0 spec/acceptance/handset_detection_spec.rb