Skip to content

Commit

Permalink
updated libraries & fixed all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hubertlepicki committed Oct 11, 2012
1 parent 483d244 commit 9a10e28
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 79 deletions.
8 changes: 3 additions & 5 deletions Gemfile
Expand Up @@ -11,13 +11,11 @@ if RUBY_VERSION < '1.9'
gem "ruby-debug", ">= 0.10.3" gem "ruby-debug", ">= 0.10.3"
end end


gem "diff-lcs", "1.1.2", :require => nil gem "diff-lcs", "1.1.3", :require => nil
gem "rspec-rails" gem "rspec-rails", '>= 2.10.1'


gem "steak", :git => "git://github.com/cavalle/steak.git" gem "capybara", "1.1.2", :require => nil
gem "capybara", "0.3.9", :require => nil
gem "timecop", "0.3.5" gem "timecop", "0.3.5"
gem "mongrel", "1.2.0.pre2"
gem "cgi_multipart_eof_fix" gem "cgi_multipart_eof_fix"
gem "fastthread" gem "fastthread"
gem "pry" gem "pry"
Expand Down
80 changes: 34 additions & 46 deletions Gemfile.lock
@@ -1,10 +1,3 @@
GIT
remote: git://github.com/cavalle/steak.git
revision: 36a26d1f87a537a8e504aad72d3f628badcfce46
specs:
steak (1.1.0)
rspec (>= 1.3)

GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
Expand Down Expand Up @@ -35,34 +28,32 @@ GEM
activesupport (3.2.7) activesupport (3.2.7)
i18n (~> 0.6) i18n (~> 0.6)
multi_json (~> 1.0) multi_json (~> 1.0)
addressable (2.3.2)
arel (3.0.2) arel (3.0.2)
bson (1.2.4) bson (1.2.4)
bson_ext (1.2.4) bson_ext (1.2.4)
builder (3.0.3) builder (3.0.3)
capybara (0.3.9) capybara (1.1.2)
culerity (>= 0.2.4)
mime-types (>= 1.16) mime-types (>= 1.16)
nokogiri (>= 1.3.3) nokogiri (>= 1.3.3)
rack (>= 1.0.0) rack (>= 1.0.0)
rack-test (>= 0.5.4) rack-test (>= 0.5.4)
selenium-webdriver (>= 0.0.3) selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
cgi_multipart_eof_fix (2.5.0) cgi_multipart_eof_fix (2.5.0)
childprocess (0.1.7) childprocess (0.3.5)
ffi (~> 0.6.3) ffi (~> 1.0, >= 1.0.6)
coderay (1.0.8) coderay (1.0.8)
culerity (0.2.15) diff-lcs (1.1.3)
daemons (1.0.10)
diff-lcs (1.1.2)
erubis (2.7.0) erubis (2.7.0)
fastthread (1.0.7) fastthread (1.0.7)
ffi (0.6.3) ffi (1.1.5)
rake (>= 0.8.7)
gem_plugin (0.2.3)
hike (1.2.1) hike (1.2.1)
i18n (0.6.0) i18n (0.6.0)
journey (1.0.4) journey (1.0.4)
json (1.7.5) json (1.7.5)
json_pure (1.5.1) libwebsocket (0.1.5)
addressable
mail (2.4.4) mail (2.4.4)
i18n (>= 0.4.0) i18n (>= 0.4.0)
mime-types (~> 1.16) mime-types (~> 1.16)
Expand All @@ -71,11 +62,8 @@ GEM
mime-types (1.19) mime-types (1.19)
mongo (1.1) mongo (1.1)
bson (>= 1.0.5) bson (>= 1.0.5)
mongrel (1.2.0.pre2)
daemons (~> 1.0.10)
gem_plugin (~> 0.2.3)
multi_json (1.3.6) multi_json (1.3.6)
nokogiri (1.4.4) nokogiri (1.5.5)
polyglot (0.3.3) polyglot (0.3.3)
pry (0.9.10) pry (0.9.10)
coderay (~> 1.0.5) coderay (~> 1.0.5)
Expand Down Expand Up @@ -107,24 +95,24 @@ GEM
rdoc (3.12) rdoc (3.12)
json (~> 1.4) json (~> 1.4)
redis (2.1.1) redis (2.1.1)
rspec (2.5.0) rspec (2.11.0)
rspec-core (~> 2.5.0) rspec-core (~> 2.11.0)
rspec-expectations (~> 2.5.0) rspec-expectations (~> 2.11.0)
rspec-mocks (~> 2.5.0) rspec-mocks (~> 2.11.0)
rspec-core (2.5.1) rspec-core (2.11.1)
rspec-expectations (2.5.0) rspec-expectations (2.11.3)
diff-lcs (~> 1.1.2) diff-lcs (~> 1.1.3)
rspec-mocks (2.5.0) rspec-mocks (2.11.3)
rspec-rails (2.5.0) rspec-rails (2.11.0)
actionpack (~> 3.0) actionpack (>= 3.0)
activesupport (~> 3.0) activesupport (>= 3.0)
railties (~> 3.0) railties (>= 3.0)
rspec (~> 2.5.0) rspec (~> 2.11.0)
rubyzip (0.9.4) rubyzip (0.9.9)
selenium-webdriver (0.1.3) selenium-webdriver (2.25.0)
childprocess (~> 0.1.5) childprocess (>= 0.2.5)
ffi (~> 0.6.3) libwebsocket (~> 0.1.3)
json_pure multi_json (~> 1.0)
rubyzip rubyzip
slop (3.3.3) slop (3.3.3)
sprockets (2.1.3) sprockets (2.1.3)
Expand All @@ -138,24 +126,24 @@ GEM
polyglot polyglot
polyglot (>= 0.3.1) polyglot (>= 0.3.1)
tzinfo (0.3.33) tzinfo (0.3.33)
xpath (0.1.4)
nokogiri (~> 1.3)
yajl-ruby (1.1.0) yajl-ruby (1.1.0)


PLATFORMS PLATFORMS
ruby ruby


DEPENDENCIES DEPENDENCIES
bson_ext (>= 1.0.5) bson_ext (>= 1.0.5)
capybara (= 0.3.9) capybara (= 1.1.2)
cgi_multipart_eof_fix cgi_multipart_eof_fix
diff-lcs (= 1.1.2) diff-lcs (= 1.1.3)
fastthread fastthread
i18n (= 0.6.0) i18n (= 0.6.0)
mongo (= 1.1) mongo (= 1.1)
mongrel (= 1.2.0.pre2)
pry pry
rails (= 3.2.7) rails (= 3.2.7)
redis redis
rspec-rails rspec-rails (>= 2.10.1)
steak!
timecop (= 0.3.5) timecop (= 0.3.5)
yajl-ruby yajl-ruby
3 changes: 1 addition & 2 deletions spec/acceptance/acceptance_helper.rb
@@ -1,11 +1,10 @@
require File.dirname(__FILE__) + "/../spec_helper" require File.dirname(__FILE__) + "/../spec_helper"
require "steak"
require 'capybara/rails' require 'capybara/rails'


Capybara.default_driver = :selenium Capybara.default_driver = :selenium


RSpec.configure do |config| RSpec.configure do |config|
config.include Capybara config.include Capybara::DSL
end end


RSpec.configuration.include Capybara, :type => :acceptance RSpec.configuration.include Capybara, :type => :acceptance
Expand Down
6 changes: 3 additions & 3 deletions spec/acceptance/support/helpers.rb
@@ -1,5 +1,5 @@
module HelperMethods # Put helper methods you need to be available in all tests here.
# Put helper methods you need to be available in all tests here. def translations_path
'/translations'
end end


RSpec.configuration.include HelperMethods, :type => :acceptance
13 changes: 0 additions & 13 deletions spec/acceptance/support/paths.rb

This file was deleted.

18 changes: 10 additions & 8 deletions spec/acceptance/translations_management.rb
Expand Up @@ -2,7 +2,7 @@
# #
shared_examples_for "translations_management" do shared_examples_for "translations_management" do
scenario "see translations keys specified in main language yaml file" do scenario "see translations keys specified in main language yaml file" do
page.should have_content "hello.world" page.should have_content "Date > Formats > Default"
end end


scenario "see translations provided in language files" do scenario "see translations provided in language files" do
Expand All @@ -13,6 +13,7 @@
end end


scenario "editing translations" do scenario "editing translations" do
visit translations_path + "/?utf8=✓&search=&key=&group=application&translated=&commit=Submit"
within :css, "#pl-hello-world" do within :css, "#pl-hello-world" do
fill_in "value", :with => "Elo ziomy" fill_in "value", :with => "Elo ziomy"
click_button "Save" click_button "Save"
Expand All @@ -29,16 +30,17 @@
page.should have_content("Elo ziomy") page.should have_content("Elo ziomy")
end end


scenario "see only app translations by default, Rails ones after changing tab" do scenario "see only all translations by default, app ones after selecting from dropdown" do
page.should_not have_content("date.formats") page.should have_content("Date > Formats")
click_link "Framework Translations" select "Application", from: "group"
page.should have_content("date.formats") click_button "Submit"
page.should_not have_content("Date > Formats")
page.should have_content("World")
end end


scenario "paginate translations, 50 on every page" do scenario "paginate translations, 50 on every page" do
click_link "Framework Translations" page.should have_content("Date > Formats")
page.should_not have_content("helpers.submit.submit")
click_link "2" click_link "2"
page.should have_content("helpers.submit.submit") page.should_not have_content("Date > Formats")
end end
end end
4 changes: 2 additions & 2 deletions spec/unit/translator_spec.rb
Expand Up @@ -7,9 +7,9 @@
I18n.backend = Translator.setup_backend(I18n::Backend::Simple.new) I18n.backend = Translator.setup_backend(I18n::Backend::Simple.new)
end end


it "should list non-framework keys by default" do it "should list all keys by default" do
Translator.keys_for_strings.should include("hello.world") Translator.keys_for_strings.should include("hello.world")
Translator.keys_for_strings.should_not include("helpers.submit.update") Translator.keys_for_strings.should include("helpers.submit.update")
end end


it "should list only keys that their values are Strings in Yaml files" do it "should list only keys that their values are Strings in Yaml files" do
Expand Down

0 comments on commit 9a10e28

Please sign in to comment.