From 62deca4796ecf68612eb69c45be3bd7594acb9a5 Mon Sep 17 00:00:00 2001 From: Tammy Date: Mon, 28 Mar 2016 21:37:50 -0700 Subject: [PATCH 01/19] trying to write cucuember test... --- Gemfile.lock | 5 ++- db/db_development | Bin 0 -> 159744 bytes db/db_test | Bin 0 -> 143360 bytes features/create_category.feature | 19 +++++++++++ features/support/paths.rb | 2 ++ public/javascripts/ckeditor/config.bak | 2 +- public/javascripts/ckeditor/config.js | 2 +- .../controllers/categories_controller_spec.rb | 30 +++++++++++++++--- 8 files changed, 53 insertions(+), 7 deletions(-) create mode 100644 db/db_development create mode 100644 db/db_test create mode 100644 features/create_category.feature mode change 100644 => 100755 public/javascripts/ckeditor/config.bak mode change 100644 => 100755 public/javascripts/ckeditor/config.js diff --git a/Gemfile.lock b/Gemfile.lock index 64eb36cc1c..637cf5f00d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,5 +1,5 @@ GEM - remote: http://rubygems.org/ + remote: https://rubygems.org/ specs: RedCloth (4.2.9) abstract (1.0.0) @@ -205,3 +205,6 @@ DEPENDENCIES thin uuidtools (~> 2.1.1) webrat + +BUNDLED WITH + 1.11.2 diff --git a/db/db_development b/db/db_development new file mode 100644 index 0000000000000000000000000000000000000000..bc7802c16085fbb5cadc3431bf9eead043ed76d7 GIT binary patch literal 159744 zcmeI53ve6Bd7v>s4?uvNX;KmeaVai`;BqNgOA!x(53RH^SIgCES8tJCDJvTu0z+a} z00x>FNTOY~57fqI=aTc~Rjwp;Dd(Yu1OhL@?=<|z;Fkmf!h0PJ()kg*gV)e624?UuD4_qOZz{z&HEj4{Nr%Ue;98 z)(d6L@^tw0m6hey6=ik#$#W}8!gEe2M-qB5p`5+2x^iaaigM}7+4IX+t}D;2TvwLY zRxh5t0N0&gxv;8SxCp;%=gvK*By8O-YYFAHY8FbWc_fp|CBap#+a<&7a9%fxTM5P1 z?%EKBo#ab)rQCD@cdc5~zyvplcDJCJHM@C!Q`@>@m_@52Vzpd0?&J$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t|Ue2L;r*;rT0?aLLqQT6u!)BjEXg?^p>75y{%$MlQzcVRW)*XYmFpM^Dn zAEQ4=zmIOy_fw0OX_4NbYxF!_p-;d{!7(~b$7!4n(mooHzb$`L{<{3K{1y4j_uU*Y zAQC_VNB{{S0VIF~kN^@u0!RP}Ab}nUh(|~uD(nwWlYk(E_Jtp1I=D}qV$S=-N0=HC zCz%=yCwL$lp5TF~s4!<59_P+-_+joWi(|}L4j<;uQh1a*OX5S!SqhJE=YjAc?mQsI zne#ySAb0K$4|C^!@c?t~55ocw*b@_BttTqP!myeHr%@3WZ=ymp49hfd+9$#~OjPI# z!vYJOMnqUei3*W0ERn!zScHX;s1OdrY6qN(BCKmf1u+bZ7jQ~MSe}RqBn)d1a2gU} zl_4sG!myM8r$Ko0A5Mb=RtBO`@B4o}qQ=XR01`j~NB{{S0VIF~kN^@u0!RP}Ab~wV G;Qs;DbrMYg literal 0 HcmV?d00001 diff --git a/db/db_test b/db/db_test new file mode 100644 index 0000000000000000000000000000000000000000..d06a171416c0e99b07f62a036abd8ece5567aa82 GIT binary patch literal 143360 zcmeI53yfUXS;yybcE`K+z1QotGjW`?XUB2vNwUejA8B5;GfAAR*N(H>*h$mL-I=?) z7tbsA-m$$Y4Vq1WHc%)~RiY26RD~AtC~BbsR8R#Kj|P>3+6pKVg^Ctc5DEmTp@{OG zGxyHiJ2TrP)2N9@|B?6m?mg$;^Z1?bJLi07cIAg3TGTBqveqzasufB3cKiH(-`$aj z&*yuNeh$-*^EpHp%()@$cU^CH`J8Xz8xs@!VdcC0nf=OlrO!(b?0VPqEmNPKx+S!8 z@;#F~CJOA6?2h0Eg9`!E|Ga<2_bJ~ewkwdD&_1*;6h3mqzvZ{o)v9J_72VLvmfonF z?(1t#o+}<-E=HD*pI9tLqVB9{}f@J%=Q+lNF0n?_?z zuWDw=(APICv+s7Fx0!vpyrp)My9Qn{FU*}5Yaf{nh3Dq{TXUXjof7vBuV^F|RdrRX zMkAM0qr9OS$C8;$jG9!}%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2KI5CDNb0*L?nfZ!GcKmY_l00ck) z1V8`;KmY_l00hR60OJ2K98`1(1V8`;KmY_l00ck)1V8`;KmY{#2q6CN1AN>h15CzR@4@9pE4Szje_6F0|ZH_MP`x zeE1V8`;KmY_l00ck) z1V8`;UOxgn{@;+^>r-A*UR3^F`Ihp}%GZ>yDqm6lO8E=rPn6FpzpwnZ@|()Xm5(SN zRNkk&M|nvq8Lh5SyP@+9#xi=CFOqQgmSx*RpQEx$_>gv=}q5Qk@C*@z4e?|VV{C@ep^3TZcl(*y`l`qLn`A6i6 z{5JW#d`@1J@0IVCZ+K1SU2Dvx#_WVx6nx#2QzL z35}~bs|02W1y&}RXR9Q0OeL9RPms*863H}s8_5)VoMe){m1KfFMl#MG4b0>V>;lO= zJ5Msl9wC`!Zy}jsD+*NoLszk{NcKWSZSgGR5v9nPhj8 zOt3ph#@X$GnM{GbnPi^bMl#0=B(p3}GQ)Bt(=1Ce#WEz5EKM@OQY7On8JI~ISb}7p z#YyJatt7MT7LpmZKr+p4CYfS4kxa51NhVl~WSkuf%%lqJD9Jo~6UiJqLNd#4Aemu@ zNv2tpWQxs`OtJ{c1Up1B&JG4n+Z>{TRX zQvRO&9r-_$f0Vx^f1Tp}FUwz$|5X00{CgDb|C;hu`J?iOrD^xNgR3a@@JjGSIkQ6GP5GofJDtoI?nOlTP zF9?;oS*YYqLM3h#Djwr1RX8S8{-{v7Hwl$JB2?xEq0)ziN=1cA&I^@@2o*oXRkCnU zsQjEzx$A|>9uO*XolxohLZz-1Dj60kag9*%eOx69dxgr+3YFU "General", + :permalink => "general", + :position => 1 + } + end + it "should create new category" do + post :create, params + expect(subject).to change(Category, :count).by(1) + end +end + +describe CategoriesController, "/edit" do + category = Factory(:category) + it "assigns the requested category as @category" do + get :edit, :id => category.id + expect(assigns(:category)).to eq(category) + end +end + describe CategoriesController, "/index" do before do Factory(:blog) @@ -73,14 +95,14 @@ def do_get do_get response.should render_template('articles/index') end - + it 'should render personal when template exists' do pending "Stubbing #template_exists is not enough to fool Rails" controller.stub!(:template_exists?) \ .and_return(true) do_get response.should render_template('personal') - end + end it 'should show only published articles' do do_get @@ -94,7 +116,7 @@ def do_get describe "when rendered" do render_views - + it 'should have a canonical URL' do do_get response.should have_selector('head>link[href="http://myblog.net/category/personal/"]') @@ -154,7 +176,7 @@ def do_get assert_tag :tag => "input", :attributes => { :id => "article_password" } - end + end end describe CategoriesController, "SEO Options" do From e3f9458c0aa4bd534286c9fe4eb2b4934757c258 Mon Sep 17 00:00:00 2001 From: Tammy Date: Mon, 28 Mar 2016 21:45:26 -0700 Subject: [PATCH 02/19] added new rspec test --- spec/controllers/admin/categories_controller_spec.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spec/controllers/admin/categories_controller_spec.rb b/spec/controllers/admin/categories_controller_spec.rb index bb290f4a0d..21febf80fe 100644 --- a/spec/controllers/admin/categories_controller_spec.rb +++ b/spec/controllers/admin/categories_controller_spec.rb @@ -39,6 +39,13 @@ assert_response :redirect, :action => 'index' end + describe "new category" do + it "should render :new" do + get :new + response.should render_template(:new) + end + end + describe "test_destroy with GET" do before(:each) do test_id = Factory(:category).id @@ -48,7 +55,7 @@ it 'should render destroy template' do assert_response :success - assert_template 'destroy' + assert_template 'destroy' end end @@ -62,5 +69,5 @@ assert_raise(ActiveRecord::RecordNotFound) { Category.find(test_id) } end - + end From fc57f63244e460bb50db26a269d24ff2a42ca8f5 Mon Sep 17 00:00:00 2001 From: Tammy Date: Tue, 29 Mar 2016 09:33:18 -0700 Subject: [PATCH 03/19] chaned the cucuember file name and some context --- .../{create_category.feature => add_category.feature} | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) rename features/{create_category.feature => add_category.feature} (65%) diff --git a/features/create_category.feature b/features/add_category.feature similarity index 65% rename from features/create_category.feature rename to features/add_category.feature index 50ca865231..67cc70fc8b 100644 --- a/features/create_category.feature +++ b/features/add_category.feature @@ -10,10 +10,8 @@ Feature: Create Category Scenario: Successfully add category Given I am on the admin content page When I follow "Categories" - Then I should see "Categories" And I should be on the new category page - When I fill in "category_name" with "Baby Stuff" + When I fill in "Name" with "Baby Stuff" And I press "Save" - Then I should be on the admin content page - When I follow "Categories" - Then I should see "Baby Stuff" + Then I should be on the new category page + And I should see "Baby Stuff" From a6b3df098f82f4b5262e1462dfc3d50904ca6028 Mon Sep 17 00:00:00 2001 From: Tammy Date: Tue, 29 Mar 2016 10:03:15 -0700 Subject: [PATCH 04/19] so I ran cucuember and it showes me Couldn't find Category without an ID --- db/db_test | Bin 143360 -> 143360 bytes ...gory.feature => add_edit_category.feature} | 10 +++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) rename features/{add_category.feature => add_edit_category.feature} (65%) diff --git a/db/db_test b/db/db_test index d06a171416c0e99b07f62a036abd8ece5567aa82..f941107295c789beb0965729cfa66ec92cbfb72c 100644 GIT binary patch delta 3546 zcma)9TWlj&89rl=lh}!Uylm4nc-uW8O~Y>L*dE7;9kgn*&aUGn7jHHjCsCzv<`R37 zxwtdqI8GO4x2R84q6mq;p=wp0Dk`xcctBj9TUFu-gb-+-pn%GXO637w_|N!~OA|q4 zd(O=N{r~r$|8^$#ANSpV-1k`1|-xu)2xefnNW!oMak~VmP)BA=DqV6j`;DXwW~#wU&~jnuhHQ_xUe(pV+== z4*(qHz}enWHAk`Rz(4?O*{ZCF6z)R2f0(n>O4YG14){S*vrIrLwm8S= zOI7SX&Oa0sHM3%e!2u3`jPS?c-JkH6p62>cEEt2Q1;tP-s#RK-kcayW;m-i~cibQH z$AWFqBNB-AhF?LE--TZRVJYmse&8EMgG1<>cMzJJ3jzZg!mzxI5`!gLQK)FvowcfJ z6ZlYrw8KZt9YV=kvu2VSpeD(tStk&B0^xCp!|;wt8kXuPL^XCyOQ$SO#4|^lX5F$C zZHJhy<=qgQ0d1353Y8&RWX~`gq)|1Qlu+v!fdml1Qk&@1XnO467|=0J)9@rrNmKV= zZO9A;9ulf)%xOkV+9?IkT$T}UACp2dH62f;<3f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Fq44Ad8ebz2fNS6|e(nk*BYM3l=n>!PmhQb-g+o48 z{dU!CYQ9`q@hXye={`kD@$@1R|dx{73vgeiaW#K7k(nL&SGA@b+(?a97=RXvoY<&!%HK zwf1DQ0q=OQa+**Bj=j`*)=-@)x#I~+Owa){=h&%!q!NNh Date: Tue, 29 Mar 2016 10:08:19 -0700 Subject: [PATCH 05/19] i have 2 failing tests wohhoo... now time to fix the bug --- db/db_test | Bin 143360 -> 143360 bytes .../admin/categories_controller_spec.rb | 2 +- .../controllers/categories_controller_spec.rb | 42 +++++++++--------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/db/db_test b/db/db_test index f941107295c789beb0965729cfa66ec92cbfb72c..d06a171416c0e99b07f62a036abd8ece5567aa82 100644 GIT binary patch delta 193 zcmZp8z|ru4V}dke*F+g-#;%PCOXRn+I508^u-#|if5(4+v!K9ber;YRW<}2A#FEtX z{G!a%VgW{GRmPIkijw%W%$$L*dE7;9kgn*&aUGn7jHHjCsCzv<`R37 zxwtdqI8GO4x2R84q6mq;p=wp0Dk`xcctBj9TUFu-gb-+-pn%GXO637w_|N!~OA|q4 zd(O=N{r~r$|8^$#ANSpV-1k`1|-xu)2xefnNW!oMak~VmP)BA=DqV6j`;DXwW~#wU&~jnuhHQ_xUe(pV+== z4*(qHz}enWHAk`Rz(4?O*{ZCF6z)R2f0(n>O4YG14){S*vrIrLwm8S= zOI7SX&Oa0sHM3%e!2u3`jPS?c-JkH6p62>cEEt2Q1;tP-s#RK-kcayW;m-i~cibQH z$AWFqBNB-AhF?LE--TZRVJYmse&8EMgG1<>cMzJJ3jzZg!mzxI5`!gLQK)FvowcfJ z6ZlYrw8KZt9YV=kvu2VSpeD(tStk&B0^xCp!|;wt8kXuPL^XCyOQ$SO#4|^lX5F$C zZHJhy<=qgQ0d1353Y8&RWX~`gq)|1Qlu+v!fdml1Qk&@1XnO467|=0J)9@rrNmKV= zZO9A;9ulf)%xOkV+9?IkT$T}UACp2dH62f;<3f(4W@eM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ad8ebz2fNS6|e(nk*BYM3l=n>!PmhQb-g+o48 z{dU!CYQ9`q@hXye={`kD@$@1R|dx{73vgeiaW#K7k(nL&SGA@b+(?a97=RXvoY<&!%HK zwf1DQ0q=OQa+**Bj=j`*)=-@)x#I~+Owa){=h&%!q!NNh "General", - :permalink => "general", - :position => 1 - } - end - it "should create new category" do - post :create, params - expect(subject).to change(Category, :count).by(1) - end -end - -describe CategoriesController, "/edit" do - category = Factory(:category) - it "assigns the requested category as @category" do - get :edit, :id => category.id - expect(assigns(:category)).to eq(category) - end -end +# describe CategoriesController, "/create" do +# let(:params) do +# { +# :name => "General", +# :permalink => "general", +# :position => 1 +# } +# end +# it "should create new category" do +# post :create, params +# expect(subject).to change(Category, :count).by(1) +# end +# end + +# describe CategoriesController, "/edit" do +# category = Factory(:category) +# it "assigns the requested category as @category" do +# get :edit, :id => category.id +# expect(assigns(:category)).to eq(category) +# end +# end describe CategoriesController, "/index" do before do From fddd88fe7612cead3b2b4822c0f19bcea848b386 Mon Sep 17 00:00:00 2001 From: Tammy Date: Tue, 29 Mar 2016 10:21:32 -0700 Subject: [PATCH 06/19] the spec is passing --- .../admin/categories_controller.rb | 10 ++++++---- db/db_test | Bin 143360 -> 143360 bytes 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/admin/categories_controller.rb b/app/controllers/admin/categories_controller.rb index b7026f8f29..11942ad989 100644 --- a/app/controllers/admin/categories_controller.rb +++ b/app/controllers/admin/categories_controller.rb @@ -4,10 +4,10 @@ class Admin::CategoriesController < Admin::BaseController def index; redirect_to :action => 'new' ; end def edit; new_or_edit; end - def new + def new respond_to do |format| format.html { new_or_edit } - format.js { + format.js { @category = Category.new } end @@ -25,12 +25,14 @@ def destroy def new_or_edit @categories = Category.find(:all) - @category = Category.find(params[:id]) + @category = Category.new if params[:id].nil? + @category = Category.find(params[:id]) if !params[:id].nil? + @category.attributes = params[:category] if request.post? respond_to do |format| format.html { save_category } - format.js do + format.js do @category.save @article = Article.new @article.categories << @category diff --git a/db/db_test b/db/db_test index d06a171416c0e99b07f62a036abd8ece5567aa82..463daf9a2acc30bf9279a64b5dbf7ea078ac0b5f 100644 GIT binary patch delta 53 zcmV-50LuS>;0S==2#^~AiIE&b0g16-q%Q^m5AFaD?z0gP z@#J^*Vr-239~k&Q0Og Date: Tue, 29 Mar 2016 10:30:06 -0700 Subject: [PATCH 07/19] my rspec and cucumber test are passing --- db/db_test | Bin 143360 -> 143360 bytes features/support/paths.rb | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/db/db_test b/db/db_test index 463daf9a2acc30bf9279a64b5dbf7ea078ac0b5f..9afcacbc5b6e92cb704bdbffdebea13f156dbd18 100644 GIT binary patch delta 3542 zcma)9TWlj&89rl=lh}!UvTV~dc-uW8O~Y>L_!cL2(5jpD?mAwQtT($GCsCzv<`R37 zxwtdqI8GO)Thu2iQG`U_5L&@gMI{O<4~WZit4e(WAq3hdD4?>UQh9(E{&RfET@ZOR zXXgL@|NGB>JCoNQ_r3PG@2#lt&UY^4g?E1PwI5#W5%32HfAG_DgTKM0X+cDVbSxGN z$<(w=O{V&$quRTwy;-;QIWjR3s=97%E*@9+s8Q3^DcLgOVf+vUv4ilx@L%xn@kjXA z_{Z46-^Xu))phI*^!lF_WXp6_({+3Zq5hz)Dw?eh2L0ngYbm>$WjelapZ{X_jpG~a z0f4LSxtm*>?y9yE7zltZM^jXZ!c$1}j|jF_sk+Yj0Y6A;wgpJl@rQl>(V$FSwPHPE zYpT;H_=kg%ZdIHxI3VCp5dH+b`xE}s(?TDL2BYw{pqi>p^-Aj&;<(Qd{v2?B$NeFH zG}sos|FIAl>l<+5ygi}w4zeUs=N29 znnU16P124Zv9<^$_nI|})BrU_)~z~$*b|74OI(I`Ez+=jqCheSpXC6xl-^Wxck(`Mo(y>&IBxmPRxw*v5R3ep~olTxC3Gn^6 z07%6Wpq(SBMsYO_Wir(xL&uSd4i*I)325fmMdKFsjwkKGp# z!Wi@D&)cph>*|84>lP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ibb&=+IZFYf0i4Id#J`k*{|f(7pgA-7 Wr>}d@sL!OuIQ{)QMy+KZ7##r9S}m{u diff --git a/features/support/paths.rb b/features/support/paths.rb index 90c1d3965d..955897d5f7 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -18,7 +18,7 @@ def path_to(page_name) when /^the new article page$/ '/admin/content/new' when /^the new category page$/ - '/categories/new' + '/admin/categories/new' # Add more mappings here. # Here is an example that pulls values out of the Regexp: From e0473a0ecd9290e098a62c726e5fae22c6f43ced Mon Sep 17 00:00:00 2001 From: Tammy Date: Tue, 29 Mar 2016 12:13:57 -0700 Subject: [PATCH 08/19] starting to write cucuember test for a feature that will revers all the words in a post --- features/reverse_article.feature | 19 +++++++++++++++++++ features/support/paths.rb | 2 ++ 2 files changed, 21 insertions(+) create mode 100644 features/reverse_article.feature diff --git a/features/reverse_article.feature b/features/reverse_article.feature new file mode 100644 index 0000000000..09eda08346 --- /dev/null +++ b/features/reverse_article.feature @@ -0,0 +1,19 @@ +Feature: Reverse Article + As an author + In order to see the world in a diffrente way + I want to reverse a blog + +Background: + Given the blog is set up + And I am logged into the admin panel + + Scenario: reverse a blog + Given I am on the manage articles page + Then I should see "Welcome" + And I should see "My Shiny Weblog!" + + Scenario: Create blog page not shown when blog created + Given the blog is set up + When I am on the home page + Then I should not see "My Shiny Weblog!" + And I should see "Teh Blag" diff --git a/features/support/paths.rb b/features/support/paths.rb index 955897d5f7..cc088181c7 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -19,6 +19,8 @@ def path_to(page_name) '/admin/content/new' when /^the new category page$/ '/admin/categories/new' + when /^the manage articles page$/ + '/admin/content' # Add more mappings here. # Here is an example that pulls values out of the Regexp: From 8a38f77343cd32f214378a53eed4d7a5c59128e1 Mon Sep 17 00:00:00 2001 From: Tammy Date: Tue, 29 Mar 2016 12:20:32 -0700 Subject: [PATCH 09/19] removed comment-out tests after reading Kari notes --- features/reverse_article.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/reverse_article.feature b/features/reverse_article.feature index 09eda08346..98f4584d33 100644 --- a/features/reverse_article.feature +++ b/features/reverse_article.feature @@ -9,7 +9,7 @@ Background: Scenario: reverse a blog Given I am on the manage articles page - Then I should see "Welcome" + Then I should see "Manage articles" And I should see "My Shiny Weblog!" Scenario: Create blog page not shown when blog created From a56c8a3bfe095eebfba710440adb6590ea1f3f1d Mon Sep 17 00:00:00 2001 From: Tammy Date: Tue, 29 Mar 2016 12:21:57 -0700 Subject: [PATCH 10/19] changed the feature name --- features/add_edit_category.feature | 2 +- .../controllers/categories_controller_spec.rb | 21 ------------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/features/add_edit_category.feature b/features/add_edit_category.feature index 849c65cee5..1a6cf41eeb 100644 --- a/features/add_edit_category.feature +++ b/features/add_edit_category.feature @@ -1,4 +1,4 @@ -Feature: Create Category +Feature: Add and Edit Category As an author In order to know what each blog is about I want to create categories diff --git a/spec/controllers/categories_controller_spec.rb b/spec/controllers/categories_controller_spec.rb index a9d23a2db3..d9493238e8 100644 --- a/spec/controllers/categories_controller_spec.rb +++ b/spec/controllers/categories_controller_spec.rb @@ -1,26 +1,5 @@ require 'spec_helper' -# describe CategoriesController, "/create" do -# let(:params) do -# { -# :name => "General", -# :permalink => "general", -# :position => 1 -# } -# end -# it "should create new category" do -# post :create, params -# expect(subject).to change(Category, :count).by(1) -# end -# end - -# describe CategoriesController, "/edit" do -# category = Factory(:category) -# it "assigns the requested category as @category" do -# get :edit, :id => category.id -# expect(assigns(:category)).to eq(category) -# end -# end describe CategoriesController, "/index" do before do From 430d8357960aff67bd53b8f30b8bf6e09b41785b Mon Sep 17 00:00:00 2001 From: Tammy Date: Tue, 29 Mar 2016 14:34:10 -0700 Subject: [PATCH 11/19] added a reverse option, near the edit and delete --- app/helpers/admin/base_helper.rb | 3 ++- db/db_development | Bin 159744 -> 159744 bytes db/db_test | Bin 143360 -> 143360 bytes features/reverse_article.feature | 18 ++++++++---------- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/helpers/admin/base_helper.rb b/app/helpers/admin/base_helper.rb index 00192e723d..756d92640e 100644 --- a/app/helpers/admin/base_helper.rb +++ b/app/helpers/admin/base_helper.rb @@ -17,7 +17,7 @@ def subtab(label, options = {}) end def show_page_heading - return if @page_heading.nil? or @page_heading.blank? + return if @page_heading.nil? or @page_heading.blank? heading = "" @@ -175,6 +175,7 @@ def show_actions item html = <<-HTML
#{link_to_published item} | + #{link_to _("Reverse"), :action => 'reverse', :id => item.id} | #{link_to _("Edit"), :action => 'edit', :id => item.id} | #{link_to _("Delete"), :action => 'destroy', :id => item.id} | #{get_short_url item} diff --git a/db/db_development b/db/db_development index bc7802c16085fbb5cadc3431bf9eead043ed76d7..4a23408fa201a301958deb3a3d24aa4f12057aac 100644 GIT binary patch delta 553 zcmZ{gzi-n(7>2(~tWukVF9@orN<~de)uDBLv6Hy=gcS*uDPllEf)ZT&nz;B!<+wot zp|+@km5_;rrOc?v1BJhVfw2=RWnw}|u#}}&1}3=ShVRvP_q@;6p}2J@KCh5)FwrF8 z+k3Co5rVsbyV-gA5;t#?5|o#x%K#t(;5bwqFZ3giuGVy2*A}U#SM{2^N~_eP)rRL8 z?uyAwgHl?nyJmW|6FPpd;Kt#fy{hA;exE6dB0qX874ZNhWFz+Hy(+05X*w z-JPv)EnAvpu%jPGB6c;nXnMmJ5@EmaL-*9p3DFST^uTh+J-mFlXtsCHQp z#L9y>3B1#(LUlzmWsO?3x<%L~5~Y;mAtz+(>d9Y;an zsG?ZR$fvygPM{=5g?+$%p1#4QYdq{2+_vO8Q5^Xkv&{wdS<>D}0!yBql~#hd(~g{w PS#s*6j`Yt;PuIx_XIGYU delta 220 zcmZp8z}fJCbAmKu)f`&cBv{oxg>d|0Dk{{xkgZ_$To{=5OK8 z*(_+_&9BIRgF&CMpeR2Ls7j47IX|x?HLs+Y3CIH?QJ~D^7JnU1UQVdY>Ha`>y;!$prWK>{~R&7#Xlmt@Jjiw9?j*gtlp^OX+{QUfm@(c{xljCDv zZqAA=VPt8NXO!6dC{D?7G0Opg#Vi{F7PDMX*v_KB$mGCsmx2H8X2F8X{A`MhEDY|v N)A!{w%C;3S0szN9KZXDR diff --git a/db/db_test b/db/db_test index 9afcacbc5b6e92cb704bdbffdebea13f156dbd18..9c8d478747a20b2738a1da809895a707905f1175 100644 GIT binary patch delta 227 zcmZp8z|ru4V?%zOrjdb_iHVh=xt@WUsfn4Tk%6I^u7Rm6B!&G4XeTf gN=iVwg{N=LXH-JiZfR&_VS>d7Gd+mRvI52f0Fl5qw*UYD delta 227 zcmZp8z|ru4V?%zOrlGl&k)@S^nVx}>g}J$*k%6I^u7R=uD#vKiSKBoi4N9V60xBeIG? bx`n52&1Y0X*lq!|-ogNz?GTw|1&jv(xhgmm diff --git a/features/reverse_article.feature b/features/reverse_article.feature index 98f4584d33..bd06c8d839 100644 --- a/features/reverse_article.feature +++ b/features/reverse_article.feature @@ -7,13 +7,11 @@ Background: Given the blog is set up And I am logged into the admin panel - Scenario: reverse a blog - Given I am on the manage articles page - Then I should see "Manage articles" - And I should see "My Shiny Weblog!" - - Scenario: Create blog page not shown when blog created - Given the blog is set up - When I am on the home page - Then I should not see "My Shiny Weblog!" - And I should see "Teh Blag" + Scenario: Successfully reverse articles + Given I am on the new article page + When I fill in "article_title" with "Test" + And I fill in "article__body_and_extended_editor" with "Pink shirt" + And I press "Publish" + Then I should be on the admin content page + When I follow "Reverse" + Then I should see "shirt Pink" From 676cb165227715356173210063ea77d77ed8eafa Mon Sep 17 00:00:00 2001 From: Tammy Date: Tue, 29 Mar 2016 15:23:23 -0700 Subject: [PATCH 12/19] hard coded the item id with 2, for test --- app/controllers/admin/content_controller.rb | 30 ++++++++++++++++---- app/helpers/admin/base_helper.rb | 3 +- app/views/admin/content/reverse.html.erb | 2 ++ config/routes.rb | 1 + db/db_development | Bin 159744 -> 159744 bytes 5 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 app/views/admin/content/reverse.html.erb diff --git a/app/controllers/admin/content_controller.rb b/app/controllers/admin/content_controller.rb index 6ef4ebf969..64f37c299f 100644 --- a/app/controllers/admin/content_controller.rb +++ b/app/controllers/admin/content_controller.rb @@ -13,7 +13,7 @@ def auto_complete_for_article_keywords def index @search = params[:search] ? params[:search] : {} - + @articles = Article.search_with_pagination(@search, {:page => params[:page], :per_page => this_blog.admin_display_elements}) if request.xhr? @@ -37,6 +37,24 @@ def edit new_or_edit end + def reverse + @article = Article.find(params[:id]) + if !@article.nil? + text = @atricle.body + split_text = text.split(' ') + split_text.reverse + reverse_string = "" + split_text.each do |word| + reverse_string += word + end + @article.body = reverse_string + @article.save + end + redirect_to :action => 'index' + + end + + def destroy @record = Article.find(params[:id]) @@ -44,7 +62,7 @@ def destroy flash[:error] = _("Error, you are not allowed to perform this action") return(redirect_to :action => 'index') end - + return(render 'admin/shared/destroy') unless request.post? @record.destroy @@ -77,7 +95,7 @@ def attachment_box_add def attachment_save(attachment) begin - Resource.create(:filename => attachment.original_filename, :mime => attachment.content_type.chomp, + Resource.create(:filename => attachment.original_filename, :mime => attachment.content_type.chomp, :created_at => Time.now).write_to_disk(attachment) rescue => e logger.info(e.message) @@ -92,7 +110,7 @@ def autosave @article.text_filter = current_user.text_filter if current_user.simple_editor? get_fresh_or_existing_draft_for_article - + @article.attributes = params[:article] @article.published = false set_article_author @@ -159,13 +177,13 @@ def new_or_edit @article.keywords = Tag.collection_to_string @article.tags @article.attributes = params[:article] # TODO: Consider refactoring, because double rescue looks... weird. - + @article.published_at = DateTime.strptime(params[:article][:published_at], "%B %e, %Y %I:%M %p GMT%z").utc rescue Time.parse(params[:article][:published_at]).utc rescue nil if request.post? set_article_author save_attachments - + @article.state = "draft" if @article.draft if @article.save diff --git a/app/helpers/admin/base_helper.rb b/app/helpers/admin/base_helper.rb index 756d92640e..82bd22d334 100644 --- a/app/helpers/admin/base_helper.rb +++ b/app/helpers/admin/base_helper.rb @@ -175,7 +175,8 @@ def show_actions item html = <<-HTML
#{link_to_published item} | - #{link_to _("Reverse"), :action => 'reverse', :id => item.id} | + raise + #{link_to _("Reverse"), :action => 'reverse', :id => 2} | #{link_to _("Edit"), :action => 'edit', :id => item.id} | #{link_to _("Delete"), :action => 'destroy', :id => item.id} | #{get_short_url item} diff --git a/app/views/admin/content/reverse.html.erb b/app/views/admin/content/reverse.html.erb new file mode 100644 index 0000000000..879d318a3b --- /dev/null +++ b/app/views/admin/content/reverse.html.erb @@ -0,0 +1,2 @@ +<%= @article.body %> +<%= @article.attributes %> diff --git a/config/routes.rb b/config/routes.rb index 082e0ea906..362a864f85 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -87,6 +87,7 @@ # AuthorsController match '/author/:id(.:format)', :to => 'authors#show', :format => /rss|atom/, :as => 'xml' match '/author(/:id)', :to => 'authors#show', :format => false + get '/admin/article/:id/reverse', :to => 'articles#reverse', :format => false # ThemesController scope :controller => 'theme', :filename => /.*/ do diff --git a/db/db_development b/db/db_development index 4a23408fa201a301958deb3a3d24aa4f12057aac..a78440d6a6f954261c1363c56a969d787a8b1c67 100644 GIT binary patch delta 592 zcmZ{g&ui0Q7{}iqu`{9JX=P*TEX_fgmv?=Wv};p}GZefC4nzlnlf@*(h)GBCg7mZs zf=BIgR>Xf`Y7T-I{R2FB^tdT_Ee>{352orwD!#mzm(RoZ`+45st~}h8A1&Z$bgGM^ z7aPx3PWniJwE}#B*YFOWz&3n>`|uprAkNCX4IOosR&nfmLF~ICA@BjI^5L^IN6-9W zK|e}J@ffXOw;u^V5(!PWS7U`1yQtVzZ$ly5D>aH)_xfW((Ao6kjniBA?$YCEfz4l3 zRoj-?Rg4e-*i}@Uvttpscl>amMNa5zL84u8!f@btVGwmT)h%}+FOD+l@gJ=UpB zh{5$`#!Y5enqjoL)vh;|xY^>mHAU9{Lg9c-idc{^F)7lUJ=Zf#lW|^mSzXWbtfp?V zo4uA_Z#lZr)ICY`#8jl!=6s3&Jn5zN`I*HS_+{2Tbo_)|9v z8o2Z8^WWeXWme@ZN=?ZuN=+`w%+D+45n+~x3l#GRG0QS0=jWBA=9LsPO`ham#KFYl z%)sN!o3;6&fH}`*=a{)nOpHpCAH}Im&WZW8DS<_SgNgqu1OIRSubTxAyyTz!zMpmT zuYN88Hb(x54Ez&;7Ps?Hp18gkRoV8h@=V+Un=Y^z0M-3s;Qs~G{GOkKfrXKUfs>PW TGvftjg?1JL#_cQyOn>YF3%^Z^ From df9d0d4ed9e2aacad77221df8c585d14d4a98784 Mon Sep 17 00:00:00 2001 From: Tammy Date: Tue, 29 Mar 2016 15:31:29 -0700 Subject: [PATCH 13/19] yess it seems to almost work --- app/controllers/admin/content_controller.rb | 4 ++-- app/helpers/admin/base_helper.rb | 3 +-- db/db_development | Bin 159744 -> 159744 bytes 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/controllers/admin/content_controller.rb b/app/controllers/admin/content_controller.rb index 64f37c299f..45eedfe17e 100644 --- a/app/controllers/admin/content_controller.rb +++ b/app/controllers/admin/content_controller.rb @@ -39,8 +39,8 @@ def edit def reverse @article = Article.find(params[:id]) - if !@article.nil? - text = @atricle.body + if @article != nil + text = @article.body split_text = text.split(' ') split_text.reverse reverse_string = "" diff --git a/app/helpers/admin/base_helper.rb b/app/helpers/admin/base_helper.rb index 82bd22d334..756d92640e 100644 --- a/app/helpers/admin/base_helper.rb +++ b/app/helpers/admin/base_helper.rb @@ -175,8 +175,7 @@ def show_actions item html = <<-HTML
#{link_to_published item} | - raise - #{link_to _("Reverse"), :action => 'reverse', :id => 2} | + #{link_to _("Reverse"), :action => 'reverse', :id => item.id} | #{link_to _("Edit"), :action => 'edit', :id => item.id} | #{link_to _("Delete"), :action => 'destroy', :id => item.id} | #{get_short_url item} diff --git a/db/db_development b/db/db_development index a78440d6a6f954261c1363c56a969d787a8b1c67..aa806955e8e1911255d4a0ddd3c69e942f3de56b 100644 GIT binary patch delta 110 zcmZp8z}fJCbAmKu{zMsP#{7*5YyBDdH$N0G<=N~UGmnYUaPp%#6(I%&hF=WQy5ioA zdCU?ZhUH}bcthdH)Z&ti%;L=A+{(Pf+*BL=0=vmE@ftkFhE@g!dd6mk2Brqh6XM$^ N#4~Q65YJQ~005z#B3l3e delta 101 zcmZp8z}fJCbAmKu-b5K^#=MOQYyBD7Ha`?F<=N~UGmnW;WAdXo70$+TW(fvqU2*Tp z67hyIyj+}-sl^H<8JWcjK$Kglke8U7YNKCZ$ICT2CSGH5RyIi#4{BL F004-EAb$V= From 890c0b5aa0474674509a27b542dec15340eb56cd Mon Sep 17 00:00:00 2001 From: Tammy Date: Tue, 29 Mar 2016 16:04:42 -0700 Subject: [PATCH 14/19] it reverse seccufuly succefuly --- app/controllers/admin/content_controller.rb | 6 +++--- db/db_development | Bin 159744 -> 159744 bytes 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/content_controller.rb b/app/controllers/admin/content_controller.rb index 45eedfe17e..4337f5ae28 100644 --- a/app/controllers/admin/content_controller.rb +++ b/app/controllers/admin/content_controller.rb @@ -41,11 +41,11 @@ def reverse @article = Article.find(params[:id]) if @article != nil text = @article.body - split_text = text.split(' ') - split_text.reverse + split_text = text.split + split_text.reverse! reverse_string = "" split_text.each do |word| - reverse_string += word + reverse_string = reverse_string + " " + word end @article.body = reverse_string @article.save diff --git a/db/db_development b/db/db_development index aa806955e8e1911255d4a0ddd3c69e942f3de56b..a76f8145514365611404dd72dda03fe5556bcf1a 100644 GIT binary patch delta 251 zcmZp8z}fJCbAmKu=|mZ4#?p-m%ltV48F&JDv-mkSKNK+Kk>I<>sLmj*D&1(xz~JcE zB*rKS=1ETWjWM<_$q%V4$kz+W$Slq*uFNkjO3N%NE=epZ$xO~k)pJeBEXglQNzF+u zNzE+LDalC914}05(`tO;yOP rRPacxRIr&G6|cc(Y-M0#WnigiZeVO-Y}7mu?ucr`_ky)$&M3woaMG9$|Ma3lwiA5!u$vLTd3a%-cB?|dP3Mr{MsU@ij znI$?3B^jxC3dJQrB??J7`RVDIdFhIi3*$r-OifJ;Ee(wf49#>6jCGAH6bvn_OpJg? z&&b@w!pv|pW9$P)M#IUE;*^CI7#J9SF-Yr*dpG7WOMn=blLh1TL~IJ|B2$Y?fG)}` t&aKQ#%uTh?pBxph!DnP;Y-nX*pl57mXkcp4JR!b)LOkR43Gqw?0syKjO7;K% From 940812309043422476253b9a00e9a77a28be529e Mon Sep 17 00:00:00 2001 From: Tammy Date: Tue, 29 Mar 2016 16:34:16 -0700 Subject: [PATCH 15/19] so I've just noticed I created a new feature that I didn't have to :( we should do something totaly else. I'm gonna stop writing the cucuember for it, and move on to merging articles --- app/controllers/admin/content_controller.rb | 2 +- app/views/admin/content/reverse.html.erb | 2 -- db/db_development | Bin 159744 -> 159744 bytes db/db_test | Bin 143360 -> 143360 bytes 4 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 app/views/admin/content/reverse.html.erb diff --git a/app/controllers/admin/content_controller.rb b/app/controllers/admin/content_controller.rb index 4337f5ae28..05a3db7b79 100644 --- a/app/controllers/admin/content_controller.rb +++ b/app/controllers/admin/content_controller.rb @@ -45,7 +45,7 @@ def reverse split_text.reverse! reverse_string = "" split_text.each do |word| - reverse_string = reverse_string + " " + word + reverse_string = reverse_string + " " + word end @article.body = reverse_string @article.save diff --git a/app/views/admin/content/reverse.html.erb b/app/views/admin/content/reverse.html.erb deleted file mode 100644 index 879d318a3b..0000000000 --- a/app/views/admin/content/reverse.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -<%= @article.body %> -<%= @article.attributes %> diff --git a/db/db_development b/db/db_development index a76f8145514365611404dd72dda03fe5556bcf1a..902e97bed26f77f5ea3393544b4baab43fc551ec 100644 GIT binary patch delta 219 zcmZp8z}fJCbAmKu#Y7or#)^#z%ltVk8F(ytv-mkSKNQg5k>k6^*rdlO$snyN-RR28 z>*&a-9LmVRz|YU`D9@ljIVVOsMj?Rk+i71$wniyId8W|Xx=^7a88d)kB8Cw|{TA7&XnVXqen3zvyjCGlOGhV$p QE4Do=mT`MlEYmb006iH%n*aa+ delta 241 zcmZp8z}fJCbAmKu=|mZ4#?p-m%ltV48F&JDv-mkSKNK+Kspq@LsLmj*D&1(xz~JcE zB*rKS=1GEhoXVk$3=I7I{EqSr+M;m6B!&G4XeTf gN=iVQg{N=LXHd3Gd+mRvI52f0LVu+?*IS* From 25a83d9da9b87eaaf88fd189597c1efdf5063602 Mon Sep 17 00:00:00 2001 From: Tammy Date: Wed, 30 Mar 2016 09:29:26 -0700 Subject: [PATCH 16/19] the cucuember test is passing. PR and nex feature (the real one) --- db/db_development | Bin 159744 -> 159744 bytes db/db_test | Bin 143360 -> 143360 bytes features/reverse_article.feature | 3 ++- 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/db/db_development b/db/db_development index 902e97bed26f77f5ea3393544b4baab43fc551ec..5f4ab6d15d729723adbd04dba73249f339bf400a 100644 GIT binary patch delta 175 zcmZp8z}fJCbAmKu?L--8#@dYu0x{7x1$GMIsX58{xv2^z`3fPG1^IdkAsLy)3P4nu zUs|M)mRVF>qL5frl9`;7s;A(Zl3AjVU!;(dnv+_Rs*qWtqfnBOs!&`4RH2ZRlb@cR znU}6;qhDY*xiC&-^8FY-A!7ptLo+KQGb;llJp)4{153-z|6}TzVB)4$Mn-xjh9(vU T=FJo0+b6^`Zl4g(R3HEVm_j)h delta 175 zcmZp8z}fJCbAmKu#Y7or#)^#z0x{7^Ir-`7nR)4oHu?p23dJRfMI{O)8L0}HB{~Wz zsX3`7sS5c;3a%-cB?>^P%;cO@J%zN)qT&*T%KXwIh0J1wkPHw}S&*-%P?E0@o|==K zpPQ;+Q(!l_FivFh{TMzWBTEG%V=E&=D-$z4b2Bpw6Z6ggW9pfp;sz#G29|o}2F4b~ TM$HrA+b6^`Zl4g(R3HEVpr<)5 diff --git a/db/db_test b/db/db_test index 79c0674d3a4b337a8ecc15c51d7ade14d508621e..e740888f3dbe84ffa0ec56750feda4cbebd2d612 100644 GIT binary patch delta 239 zcmZp8z|ru4V?$1zj Date: Wed, 30 Mar 2016 11:10:42 -0700 Subject: [PATCH 17/19] added cucuember test --- features/merge_articles.feature | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 features/merge_articles.feature diff --git a/features/merge_articles.feature b/features/merge_articles.feature new file mode 100644 index 0000000000..f9baaa2b55 --- /dev/null +++ b/features/merge_articles.feature @@ -0,0 +1,22 @@ +Feature: Merge Articles + As a the admin + In order to condense similar articles + I want to be able to merge articles + + Background: + Given the blog is set up + And I am logged into the admin panel + + Scenario: Successfully merge articles + Given I am on the new article page + When I fill in "article_title" with "Merge me!" + And I fill in "article__body_and_extended_editor" with "I like tomato soup" + And I press "Publish" + Then I should be on the admin content page + When I go to the home page + Then I should see "Hello World!" + And I should see "Merge me!" + When I go to the new article page + And I fill in "merge" with "1" + And I follow "Merge" + Then I should be on the new article page From b2b7babe106cf1294396d6c9bfc67c92d0fd2be0 Mon Sep 17 00:00:00 2001 From: Tammy Date: Wed, 30 Mar 2016 14:43:59 -0700 Subject: [PATCH 18/19] after reading Kari's comment I've changed the each method --- app/controllers/admin/content_controller.rb | 7 +------ db/db_development | Bin 159744 -> 159744 bytes 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/app/controllers/admin/content_controller.rb b/app/controllers/admin/content_controller.rb index 05a3db7b79..faddadd926 100644 --- a/app/controllers/admin/content_controller.rb +++ b/app/controllers/admin/content_controller.rb @@ -41,12 +41,7 @@ def reverse @article = Article.find(params[:id]) if @article != nil text = @article.body - split_text = text.split - split_text.reverse! - reverse_string = "" - split_text.each do |word| - reverse_string = reverse_string + " " + word - end + reverse_string = text.split.reverse!.join(" ") @article.body = reverse_string @article.save end diff --git a/db/db_development b/db/db_development index 5f4ab6d15d729723adbd04dba73249f339bf400a..db7028eddcf60a945fe2f922d0d8d83b2c4a6f7b 100644 GIT binary patch delta 85 zcmV-b0IL6h;0b`>36L8Be~}zR0e`Vztxo|7v*8dZ46`;|s{#Qllj2?`3IKt00~i1s rEf+36L8BeUThP0e!Jxtxo|6v*8dZ46`;|s{#Qklj2?`34wJ37yuhB s7e|v4UoHV4lR#fV4>2}6GBr9fGA=YRG&nFfgOFc`kY53}kY56D5VOV_AOHXW From cfe2958f552615702a77243dd12786710d9dd276 Mon Sep 17 00:00:00 2001 From: Tammy Date: Wed, 30 Mar 2016 14:48:15 -0700 Subject: [PATCH 19/19] changed the if statement after reading Kari's comment --- .../admin/categories_controller.rb | 8 +++++--- app/controllers/admin/content_controller.rb | 11 ++++------- db/db_development | Bin 159744 -> 159744 bytes 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/controllers/admin/categories_controller.rb b/app/controllers/admin/categories_controller.rb index 11942ad989..ae45c82377 100644 --- a/app/controllers/admin/categories_controller.rb +++ b/app/controllers/admin/categories_controller.rb @@ -25,9 +25,11 @@ def destroy def new_or_edit @categories = Category.find(:all) - @category = Category.new if params[:id].nil? - @category = Category.find(params[:id]) if !params[:id].nil? - + if params[:id].nil? + @category = Category.new + else + @category = Category.find(params[:id]) + end @category.attributes = params[:category] if request.post? respond_to do |format| diff --git a/app/controllers/admin/content_controller.rb b/app/controllers/admin/content_controller.rb index faddadd926..cedc104c5b 100644 --- a/app/controllers/admin/content_controller.rb +++ b/app/controllers/admin/content_controller.rb @@ -39,14 +39,11 @@ def edit def reverse @article = Article.find(params[:id]) - if @article != nil - text = @article.body - reverse_string = text.split.reverse!.join(" ") - @article.body = reverse_string - @article.save - end + text = @article.body + reverse_string = text.split.reverse!.join(" ") + @article.body = reverse_string + @article.save redirect_to :action => 'index' - end diff --git a/db/db_development b/db/db_development index db7028eddcf60a945fe2f922d0d8d83b2c4a6f7b..9e923b2a9253bcf437d263483fe80f15e7b560e6 100644 GIT binary patch delta 75 zcmZp8z}fJCbAmKu!$cWp#)gdv58|Y33hWd-QY#g5D;4q*b5j*Eixol=b8{FF6S delta 75 zcmZp8z}fJCbAmKu{X`jO#`=v358|Xk5_5AaZS)K56f%ny@)C1X6>=*TJW?waY$iv= fYjYc08CmF=n;BXf8#PaeZ=Vp)xP3xAQ-J^g@FE#8