Sha256: 394d98a88fb886c97bd27a3a9456144d8818d8afaa374020600f34af1dcee53d

Contents?: true

Size: 1.21 KB

Versions: 17

Compression:

Stored size: 1.21 KB

Contents

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

class RecodeController < ApplicationController
  class << self
    attr_accessor :string
  end

  def index
    render :layout => true, :inline => "Test"
  end

  def new
    render :layout => true, :inline => <<-EOD
    <form action="/recode/create" method="post">
    <input id="string" name="string" type="text">
    <input name="commit" type="submit" value="Submit">
    </form>
    EOD
  end

  def create
    self.class.string = params[:string]
  end
end

feature 'recode' do
  scenario 'au SSL', :driver => :au do
    visit 'https://www.example.com/recode/index'
    page.find(:xpath, '//head/meta')['content'].should == "text/html; charset=Shift_JIS"
  end

  scenario 'post request with Shift JIS data on au SSL', :driver => :au do
    visit 'https://www.example.com/recode/new'
    fill_in 'string', :with => "\x82\xA0"
    click_button "Submit"
    RecodeController.string.should == "あ"
  end

  scenario 'post request with UTF-8 data on au SSL', :driver => :au do
    visit 'https://www.example.com/recode/new'
    fill_in 'string', :with => "あ"
    click_button "Submit"
    RecodeController.string.should_not == "あ"
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
galakei-0.11.3 spec/acceptance/recode_spec.rb
galakei-0.11.2 spec/acceptance/recode_spec.rb
galakei-0.11.1 spec/acceptance/recode_spec.rb
galakei-0.11.0 spec/acceptance/recode_spec.rb
galakei-0.10.1 spec/acceptance/recode_spec.rb
galakei-0.10.0 spec/acceptance/recode_spec.rb
galakei-0.9.1 spec/acceptance/recode_spec.rb
galakei-0.9.0 spec/acceptance/recode_spec.rb
galakei-0.8.1 spec/acceptance/recode_spec.rb
galakei-0.8.0 spec/acceptance/recode_spec.rb
galakei-0.7.3 spec/acceptance/recode_spec.rb
galakei-0.7.2 spec/acceptance/recode_spec.rb
galakei-0.7.1 spec/acceptance/recode_spec.rb
galakei-0.7.0 spec/acceptance/recode_spec.rb
galakei-0.6.6 spec/acceptance/recode_spec.rb
galakei-0.6.5 spec/acceptance/recode_spec.rb
galakei-0.6.4 spec/acceptance/recode_spec.rb