Sha256: e1bb30e0e0ec63621c1ea31ce35e74f94b48cd2540666eb008c2a03ce5083356

Contents?: true

Size: 928 Bytes

Versions: 8

Compression:

Stored size: 928 Bytes

Contents

# encoding: UTF-8
require 'acceptance/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

8 entries across 8 versions & 1 rubygems

Version Path
galakei-0.15.2 spec/acceptance/handset_detection_spec.rb
galakei-0.15.1 spec/acceptance/handset_detection_spec.rb
galakei-0.15.0 spec/acceptance/handset_detection_spec.rb
galakei-0.14.4 spec/acceptance/handset_detection_spec.rb
galakei-0.14.3 spec/acceptance/handset_detection_spec.rb
galakei-0.14.2 spec/acceptance/handset_detection_spec.rb
galakei-0.14.1 spec/acceptance/handset_detection_spec.rb
galakei-0.14.0 spec/acceptance/handset_detection_spec.rb